Skip to content

Instantly share code, notes, and snippets.

@chrisfinne
Created June 2, 2013 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisfinne/5694324 to your computer and use it in GitHub Desktop.
Save chrisfinne/5694324 to your computer and use it in GitHub Desktop.
ruby class vs. instance method
>> class Foo
>>
?> def self.bar
>> "i'm a class method"
>> end
>>
?> def bar
>> "i'm an instance method"
>> end
>>
?> end
=> nil
>> Foo.bar
=> "i'm a class method"
>> f=Foo.new
=> #<Foo:0x00000100c18cd8>
>> f.bar
=> "i'm an instance method"
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment