Class: Crm::RoomLayoutPreviewComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Crm::RoomLayoutPreviewComponent
- Defined in:
- app/components/crm/room_layout_preview_component.rb
Overview
ViewComponent: renders the room layout preview block.
Shows the room configuration's interactive room plan when one exists and
the reception came from the design tool; otherwise links to the first
uploaded room layout image in a Fancybox viewer, or a "No layout" label.
Instance Attribute Summary collapse
-
#room_configuration ⇒ RoomConfiguration?
readonly
The room configuration being previewed.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(room_configuration:, size: '92x61>') ⇒ RoomLayoutPreviewComponent
constructor
A new instance of RoomLayoutPreviewComponent.
-
#render? ⇒ Boolean
True when there is a room configuration to preview.
Constructor Details
#initialize(room_configuration:, size: '92x61>') ⇒ RoomLayoutPreviewComponent
Returns a new instance of RoomLayoutPreviewComponent.
19 20 21 22 |
# File 'app/components/crm/room_layout_preview_component.rb', line 19 def initialize(room_configuration:, size: '92x61>') @room_configuration = room_configuration @size = size end |
Instance Attribute Details
#room_configuration ⇒ RoomConfiguration? (readonly)
Returns the room configuration being previewed.
15 16 17 |
# File 'app/components/crm/room_layout_preview_component.rb', line 15 def room_configuration @room_configuration end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
15 |
# File 'app/components/crm/room_layout_preview_component.rb', line 15 attr_reader :room_configuration, :size |
Instance Method Details
#render? ⇒ Boolean
Returns true when there is a room configuration to preview.
25 26 27 |
# File 'app/components/crm/room_layout_preview_component.rb', line 25 def render? room_configuration.present? end |