Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Call-an-object-method/Ruby/call-an-object-method.rb
Normal file
16
Task/Call-an-object-method/Ruby/call-an-object-method.rb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Class method
|
||||
MyClass.some_method(some_parameter)
|
||||
|
||||
# Class may be computed at runtime
|
||||
foo = MyClass
|
||||
foo.some_method(some_parameter)
|
||||
|
||||
|
||||
# Instance method
|
||||
my_instance.a_method(some_parameter)
|
||||
|
||||
# The parentheses are optional
|
||||
my_instance.a_method some_parameter
|
||||
|
||||
# Calling a method with no parameters
|
||||
my_instance.another_method
|
||||
Loading…
Add table
Add a link
Reference in a new issue