-
-
Save karavanis/7099421 to your computer and use it in GitHub Desktop.
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
# self | |
class Foo | |
# self | |
# belongs_to | |
def Foo.foo | |
@bla = '123' | |
puts 'bla' | |
end | |
def Foo.bar | |
@bla | |
end | |
def bar | |
# self is instance of foo | |
end | |
class << self | |
def foo2 | |
end | |
end | |
def call(bla) | |
puts bla | |
end | |
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
a = "Kostas" | |
puts a.reverse | |
puts a.length | |
class << a | |
def reverse | |
'bla' | |
end | |
def length | |
'computers says no' | |
end | |
end | |
puts a.reverse | |
puts a.length |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment