SHARE
TWEET

Untitled

a guest Mar 6th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Person
  2.     def initialize( name, age )
  3.         @name = name
  4.         @age = age
  5.     end
  6.  
  7.     def age
  8.         @age
  9.     end
  10.    
  11.     def age=(age)
  12.         @age = age
  13.     end
  14. end
  15.  
  16. person = Person.new('Ivan', 17)
  17. p person.age
  18. person.age = 18,19
  19. p person.age # [18, 19]
  20. #person.age = (18, 19) # syntax error, unexpected ',', expecting ')'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top