Class: Maglove::Widget::V2
Direct Known Subclasses
Button, Card, Columns, Container, Heading, HorizontalRule, Image, Listitem, Page, Paragraph, Property, RawHtml, ScrollableImage, Slider, Video, Youtube
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#defaults, #identifier, #initialize, #style_string
Constructor Details
This class inherits a constructor from Maglove::Widget::Base
Instance Method Details
#render(&block) ⇒ Object
48 49 50 51 52 |
# File 'lib/maglove/widget.rb', line 48 def render(&block) haml_tag "#{identifier}-widget", do yield self if block_given? end end |
#widget_options ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/maglove/widget.rb', line 35 def attributes = { widget: true } @options.each do |key, value| attributes[key.to_s.dasherize.to_s] = value end if attributes["padding"] attributes["padding"] = attributes["padding"].join(" ") else attributes["padding"] = "0 0 0 0" end attributes end |