Creating new structures for data

suggest change

Struct defines new classes with the specified attributes and accessor methods.

Person = Struct.new :first_name, :last_name

You can then instantiate objects and use them:

person = Person.new 'John', 'Doe'
# => #<struct Person first_name="John", last_name="Doe">

person.first_name
# => "John"

person.last_name
# => "Doe"

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents