Class: Practical::Views::ModalDialogComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/practical/views/modal_dialog_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ElementHelper

#grab, #mix

Constructor Details

#initialize(id:, open: false, options: {}) ⇒ ModalDialogComponent

Returns a new instance of ModalDialogComponent.



7
8
9
10
11
# File 'app/components/practical/views/modal_dialog_component.rb', line 7

def initialize(id:, open: false, options: {})
  self.open = open
  self.id = id
  self.options = options
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



5
6
7
# File 'app/components/practical/views/modal_dialog_component.rb', line 5

def id
  @id
end

#openObject

Returns the value of attribute open.



5
6
7
# File 'app/components/practical/views/modal_dialog_component.rb', line 5

def open
  @open
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'app/components/practical/views/modal_dialog_component.rb', line 5

def options
  @options
end

Instance Method Details

#finalized_optionsObject



13
14
15
# File 'app/components/practical/views/modal_dialog_component.rb', line 13

def finalized_options
  mix({id: id, open: open, data: {ensure_modal: true}, class: 'wa-dialog-stack-patch'}, options)
end