Class: Hamloft::Widget
- Inherits:
-
Object
- Object
- Hamloft::Widget
- Includes:
- Helpers
- Defined in:
- lib/hamloft/widget.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #defaults ⇒ Object
- #identifier ⇒ Object
-
#initialize(options) ⇒ Widget
constructor
A new instance of Widget.
- #typeloft_widget_options ⇒ Object
Methods included from Helpers
#asset, #asset_uri, #block, #drop_container, #font, #link, #parse_html, #root_asset, #style, #style_string, #var, #variable, #widget_block
Constructor Details
#initialize(options) ⇒ Widget
Returns a new instance of Widget.
14 15 16 |
# File 'lib/hamloft/widget.rb', line 14 def initialize() = defaults.merge() end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/hamloft/widget.rb', line 4 def end |
Instance Method Details
#defaults ⇒ Object
10 11 12 |
# File 'lib/hamloft/widget.rb', line 10 def defaults {} end |
#identifier ⇒ Object
6 7 8 |
# File 'lib/hamloft/widget.rb', line 6 def identifier 'base' end |
#typeloft_widget_options ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/hamloft/widget.rb', line 18 def attributes = { :class => '_typeloft_widget', :"data-widget-identifier" => identifier } .each do |k, v| attributes["data-attribute-#{k}"] = v end attributes end |