Class: Formidable::Elements::BasicElement
- Inherits:
-
Object
- Object
- Formidable::Elements::BasicElement
- Includes:
- Rendering
- Defined in:
- lib/formidable/elements.rb
Direct Known Subclasses
Constant Summary
Constants included from Rendering
Rendering::RendererNotAssigned
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
- #cleaned_data ⇒ Object
-
#content ⇒ Object
Returns the value of attribute content.
-
#name ⇒ Object
Returns the value of attribute name.
-
#raw_data ⇒ Object
Returns the value of attribute raw_data.
-
#tag ⇒ Object
Returns the value of attribute tag.
Attributes included from Rendering
Instance Method Summary collapse
-
#initialize(tag, name, attributes = Hash.new, raw_data = nil) ⇒ BasicElement
constructor
A new instance of BasicElement.
Methods included from Rendering
Constructor Details
#initialize(tag, name, attributes = Hash.new, raw_data = nil) ⇒ BasicElement
Returns a new instance of BasicElement.
15 16 17 18 19 |
# File 'lib/formidable/elements.rb', line 15 def initialize(tag, name, attributes = Hash.new, raw_data = nil) @tag, @name, @attributes = tag, name, attributes @attributes.merge!(name: name) if name self.raw_data = raw_data if raw_data end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
11 12 13 |
# File 'lib/formidable/elements.rb', line 11 def attributes @attributes end |
#cleaned_data ⇒ Object
21 22 23 |
# File 'lib/formidable/elements.rb', line 21 def cleaned_data @cleaned_data || self.raw_data end |
#content ⇒ Object
Returns the value of attribute content.
9 10 11 |
# File 'lib/formidable/elements.rb', line 9 def content @content end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/formidable/elements.rb', line 9 def name @name end |
#raw_data ⇒ Object
Returns the value of attribute raw_data.
9 10 11 |
# File 'lib/formidable/elements.rb', line 9 def raw_data @raw_data end |
#tag ⇒ Object
Returns the value of attribute tag.
9 10 11 |
# File 'lib/formidable/elements.rb', line 9 def tag @tag end |