Skip to content

Instantly share code, notes, and snippets.

View mrorii's full-sized avatar

Naoki Orii mrorii

View GitHub Profile
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
;; ruby-electric の設定
(require 'ruby-electric)
(add-hook 'ruby-mode-hook '(lambda () (ruby-electric-mode t)))
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")
<?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>
class Hoge
def initialize(state, foo)
@state = state
@foo = foo
end
def state=(state)
@state = state
end
class Hoge
def initialize(state, foo)
@state = state
@foo = foo
end
def state=(new_state)
@state = new_state
end
class Hoge
def initialize(state, foo)
@state = state
@foo = foo
end
def state=(new_state)
@state = new_state
end
class Hoge
def initialize(state, foo)
@state = state
@foo = foo
end
# セッター
def state=(new_state)
@state = new_state
class Hoge
attr_reader :foo
end
class Hoge
def foo
@foo
class Hoge
attr_reader :foo
end
class Hoge
def foo
@foo