Class: Shoehorn::Components::Modal

Inherits:
Base
  • Object
show all
Defined in:
lib/shoehorn/components/modal.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#options, #output_buffer

Instance Method Summary collapse

Constructor Details

#initialize(body_elements, footer_elements, options = {}) ⇒ Modal

Returns a new instance of Modal.



5
6
7
8
9
# File 'lib/shoehorn/components/modal.rb', line 5

def initialize(body_elements, footer_elements, options = {})
  super
  @body_elements = body_elements
  @footer_elements = footer_elements
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



3
4
5
# File 'lib/shoehorn/components/modal.rb', line 3

def collection
  @collection
end

Instance Method Details

#to_sObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/shoehorn/components/modal.rb', line 11

def to_s
  output_buffer << (:div, :id => options[:id], :class => modal_classes) do
    html=''
    html << build_header
    html << build_body
    html << build_footer
    html.html_safe
  end
  super
end