Class: Shoehorn::Components::Base

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
lib/shoehorn/components/base.rb

Direct Known Subclasses

Alert, Badge, Button, Dropdown, Form, Icon, Label, Modal, Navigation, ProgressBar

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Base

Returns a new instance of Base.



8
9
10
11
# File 'lib/shoehorn/components/base.rb', line 8

def initialize(*args)
  @output_buffer = ""
  @options = args.extract_options!.reverse_merge(default_options)
end

Instance Attribute Details

#default_optionsObject

Returns the value of attribute default_options.



6
7
8
# File 'lib/shoehorn/components/base.rb', line 6

def default_options
  @default_options
end

#optionsObject

Returns the value of attribute options.



6
7
8
# File 'lib/shoehorn/components/base.rb', line 6

def options
  @options
end

#output_bufferObject

Returns the value of attribute output_buffer.



6
7
8
# File 'lib/shoehorn/components/base.rb', line 6

def output_buffer
  @output_buffer
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/shoehorn/components/base.rb', line 13

def to_s
  @output_buffer.to_s.html_safe
end