Skip to content

Instantly share code, notes, and snippets.

@futoase
Created December 14, 2013 04:33
Show Gist options
  • Select an option

  • Save futoase/7955708 to your computer and use it in GitHub Desktop.

Select an option

Save futoase/7955708 to your computer and use it in GitHub Desktop.
class Hoge
attr_accessor :hoge
def initialize; end
end
> h = Hoge.new
> h.hoge = 3
> h.hoge
> 3
@futoase

futoase commented Dec 14, 2013

Copy link
Copy Markdown
Author
class Hoge
  def hoge=(n)
    @hoge = n
  end
  def hoge
    @hoge
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment