Class: Forma::Html::ClassAttr
Overview
Class attribute.
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(values) ⇒ ClassAttr
constructor
A new instance of ClassAttr.
- #to_s ⇒ Object
Constructor Details
#initialize(values) ⇒ ClassAttr
Returns a new instance of ClassAttr.
71 72 73 |
# File 'lib/forma/html.rb', line 71 def initialize(values) @values = values end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
70 71 72 |
# File 'lib/forma/html.rb', line 70 def values @values end |
Instance Method Details
#to_s ⇒ Object
75 76 77 78 79 80 81 82 83 |
# File 'lib/forma/html.rb', line 75 def to_s if @values.present? if @values.is_a?(Array) %Q{class="#{@values.join(" ")}"} else %Q{class="#{@values}"} end end end |