Class: Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cityObject

Returns the value of attribute city.



2
3
4
# File 'lib/reader.rb', line 2

def city
  @city
end

#emailObject

Returns the value of attribute email.



2
3
4
# File 'lib/reader.rb', line 2

def email
  @email
end

#houseObject

Returns the value of attribute house.



2
3
4
# File 'lib/reader.rb', line 2

def house
  @house
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/reader.rb', line 2

def name
  @name
end

#streetObject

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_hObject



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