Class: ExampleInstallation
- Inherits:
-
Object
- Object
- ExampleInstallation
- Includes:
- ActiveModel::Serialization
- Defined in:
- app/models/example_installation.rb
Instance Method Summary collapse
- #coverage ⇒ Object
- #image ⇒ Object
-
#initialize(room_configuration) ⇒ ExampleInstallation
constructor
A new instance of ExampleInstallation.
- #operating_cost ⇒ Object
- #price ⇒ Object
- #room_type_name ⇒ Object
- #voltage ⇒ Object
- #wattage ⇒ Object
Constructor Details
#initialize(room_configuration) ⇒ ExampleInstallation
Returns a new instance of ExampleInstallation.
5 6 7 |
# File 'app/models/example_installation.rb', line 5 def initialize(room_configuration) @room_configuration = room_configuration end |
Instance Method Details
#coverage ⇒ Object
18 19 20 |
# File 'app/models/example_installation.rb', line 18 def coverage @room_configuration.coverage_percentage || 100 # need some number here end |
#image ⇒ Object
9 10 11 12 |
# File 'app/models/example_installation.rb', line 9 def image #Plan images can be served directly from the room configuration using send_file. Discontinuing vignette plan images #@room_configuration.vignette_plan_image end |
#operating_cost ⇒ Object
30 31 32 |
# File 'app/models/example_installation.rb', line 30 def @room_configuration. end |
#price ⇒ Object
14 15 16 |
# File 'app/models/example_installation.rb', line 14 def price @room_configuration.total.to_f.round(2) end |
#room_type_name ⇒ Object
34 35 36 |
# File 'app/models/example_installation.rb', line 34 def room_type_name @room_configuration.room_type.name end |
#voltage ⇒ Object
26 27 28 |
# File 'app/models/example_installation.rb', line 26 def voltage @room_configuration.control_voltage || @room_configuration.line_items.heating_elements.first.item.voltage # need some number here end |
#wattage ⇒ Object
22 23 24 |
# File 'app/models/example_installation.rb', line 22 def wattage @room_configuration.calculate_total_watts end |