Class: Maglove::Widget::LegacyProperty

Inherits:
V1
  • Object
show all
Defined in:
lib/maglove/widget/property.rb

Instance Attribute Summary

Attributes inherited from Base

#options, #scope

Instance Method Summary collapse

Methods inherited from V1

#drop_container, #widget_options

Methods inherited from Base

#initialize, #style_string, #widget_options

Constructor Details

This class inherits a constructor from Maglove::Widget::Base

Instance Method Details

#defaultsObject



14
15
16
17
18
19
# File 'lib/maglove/widget/property.rb', line 14

def defaults
  {
    label: "Label",
    value: "Value"
  }
end

#identifierObject



10
11
12
# File 'lib/maglove/widget/property.rb', line 10

def identifier
  "property"
end

#render(&block) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/maglove/widget/property.rb', line 21

def render(&block)
  super do
    haml_tag :div, property_options do
      haml_tag :span, class: "property-label" do
        haml_concat(options[:label])
      end
      haml_tag :span, class: "property-value" do
        haml_concat(options[:value])
      end
      haml_tag :span, class: "clearfix"
    end
  end
end