Class: Crm::RoomLayoutPreviewComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/crm/room_layout_preview_component.rb

Overview

ViewComponent: renders the room layout preview block.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(room_configuration:, size: '92x61>') ⇒ RoomLayoutPreviewComponent

Returns a new instance of RoomLayoutPreviewComponent.



8
9
10
11
# File 'app/components/crm/room_layout_preview_component.rb', line 8

def initialize(room_configuration:, size: '92x61>')
  @room_configuration = room_configuration
  @size = size
end

Instance Attribute Details

#room_configurationObject (readonly)

Returns the value of attribute room_configuration.



6
7
8
# File 'app/components/crm/room_layout_preview_component.rb', line 6

def room_configuration
  @room_configuration
end

#sizeObject (readonly)

Returns the value of attribute size.



6
7
8
# File 'app/components/crm/room_layout_preview_component.rb', line 6

def size
  @size
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/components/crm/room_layout_preview_component.rb', line 13

def render?
  room_configuration.present?
end