This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 100.times(){|i| | |
| i += 1 | |
| if i%5 == 0 && i%3 == 0 then | |
| puts "FizzBuzz" | |
| elsif i%5 == 0 | |
| puts "Buzz" | |
| elsif i%3 == 0 | |
| puts "Fizz" | |
| else | |
| puts i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; ruby-electric の設定 | |
| (require 'ruby-electric) | |
| (add-hook 'ruby-mode-hook '(lambda () (ruby-electric-mode t))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| gem 'wxruby' | |
| require 'wx' | |
| require 'open-uri' | |
| class Hello < Wx::App | |
| def on_init | |
| resource = Wx::XmlResource.get | |
| resource.init_all_handlers | |
| resource.load("09-004-hello.wxg") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <resource xmlns="http://www.wxwindow.org.wxxrc" version="2.3.0.1"> | |
| <object name="main" class="wxFrame"> | |
| <style>wxDEFAULT_FRAME_STYLE</style> | |
| <title>Welcome to WxRuby</title> | |
| <size>400,300</size> | |
| <object class="wxTextCtrl" name="url"> | |
| <pos>10,10</pos> | |
| <size>320,30</size> | |
| <focus>true</focus> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Hoge | |
| def initialize(state, foo) | |
| @state = state | |
| @foo = foo | |
| end | |
| def state=(state) | |
| @state = state | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Hoge | |
| def initialize(state, foo) | |
| @state = state | |
| @foo = foo | |
| end | |
| def state=(new_state) | |
| @state = new_state | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Hoge | |
| def initialize(state, foo) | |
| @state = state | |
| @foo = foo | |
| end | |
| def state=(new_state) | |
| @state = new_state | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Hoge | |
| def initialize(state, foo) | |
| @state = state | |
| @foo = foo | |
| end | |
| # セッター | |
| def state=(new_state) | |
| @state = new_state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Hoge | |
| attr_reader :foo | |
| end | |
| は | |
| class Hoge | |
| def foo | |
| @foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Hoge | |
| attr_reader :foo | |
| end | |
| は | |
| class Hoge | |
| def foo | |
| @foo |