Class: Ensuppar::Entities::Building
- Inherits:
-
Object
- Object
- Ensuppar::Entities::Building
- Defined in:
- lib/ensuppar/entities/building.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#energy_schedules ⇒ Object
readonly
Returns the value of attribute energy_schedules.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#street ⇒ Object
readonly
Returns the value of attribute street.
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(city:, street:, number:, energy_schedules: []) ⇒ Building
constructor
A new instance of Building.
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
#city ⇒ Object (readonly)
Returns the value of attribute city.
4 5 6 |
# File 'lib/ensuppar/entities/building.rb', line 4 def city @city end |
#energy_schedules ⇒ Object (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 |
#number ⇒ Object (readonly)
Returns the value of attribute number.
4 5 6 |
# File 'lib/ensuppar/entities/building.rb', line 4 def number @number end |
#street ⇒ Object (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
#info ⇒ Object
13 14 15 |
# File 'lib/ensuppar/entities/building.rb', line 13 def info "#{city}, #{street} #{number}: #{energy_schedules.map(&:info).join(", ")}" end |