Class: Ensuppar::Entities::Building

Inherits:
Object
  • Object
show all
Defined in:
lib/ensuppar/entities/building.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(city:, street:, number:, energy_schedules: []) ⇒ Building

Returns a new instance of Building.



6
7
8
9
10
11
# File 'lib/ensuppar/entities/building.rb', line 6

def initialize(city:, street:, number:, energy_schedules: [])
  @city = city
  @street = street
  @number = number
  @energy_schedules = energy_schedules
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



4
5
6
# File 'lib/ensuppar/entities/building.rb', line 4

def city
  @city
end

#energy_schedulesObject (readonly)

Returns the value of attribute energy_schedules.



4
5
6
# File 'lib/ensuppar/entities/building.rb', line 4

def energy_schedules
  @energy_schedules
end

#numberObject (readonly)

Returns the value of attribute number.



4
5
6
# File 'lib/ensuppar/entities/building.rb', line 4

def number
  @number
end

#streetObject (readonly)

Returns the value of attribute street.



4
5
6
# File 'lib/ensuppar/entities/building.rb', line 4

def street
  @street
end

Instance Method Details

#infoObject



13
14
15
# File 'lib/ensuppar/entities/building.rb', line 13

def info
  "#{city}, #{street} #{number}: #{energy_schedules.map(&:info).join(", ")}"
end