Class: Reader
- Inherits:
-
Object
- Object
- Reader
- Defined in:
- lib/reader.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#email ⇒ Object
Returns the value of attribute email.
-
#house ⇒ Object
Returns the value of attribute house.
-
#name ⇒ Object
Returns the value of attribute name.
-
#street ⇒ Object
Returns the value of attribute street.
Instance Method Summary collapse
-
#initialize(name, email) ⇒ Reader
constructor
A new instance of Reader.
- #set_address(city, street, house) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(name, email) ⇒ Reader
Returns a new instance of Reader.
4 5 6 7 |
# File 'lib/reader.rb', line 4 def initialize(name, email) @name = name @email = email end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
2 3 4 |
# File 'lib/reader.rb', line 2 def city @city end |
#email ⇒ Object
Returns the value of attribute email.
2 3 4 |
# File 'lib/reader.rb', line 2 def email @email end |
#house ⇒ Object
Returns the value of attribute house.
2 3 4 |
# File 'lib/reader.rb', line 2 def house @house end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/reader.rb', line 2 def name @name end |
#street ⇒ Object
Returns the value of attribute street.
2 3 4 |
# File 'lib/reader.rb', line 2 def street @street end |
Instance Method Details
#set_address(city, street, house) ⇒ Object
9 10 11 12 13 |
# File 'lib/reader.rb', line 9 def set_address(city, street, house) @city = city @street = street @house = house end |
#to_h ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/reader.rb', line 15 def to_h { name: name, email: email, city: city, street: street, house: house } end |