Class: Formalist::Element::Attributes
- Inherits:
-
Object
- Object
- Formalist::Element::Attributes
- Defined in:
- lib/formalist/element/attributes.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the attributes hash.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Attributes
constructor
Creates an attributes object from the supplied hash.
-
#to_ast ⇒ Array
Returns the attributes as an abstract syntax tree.
Constructor Details
#initialize(attrs = {}) ⇒ Attributes
Creates an attributes object from the supplied hash.
10 11 12 |
# File 'lib/formalist/element/attributes.rb', line 10 def initialize(attrs = {}) @attrs = attrs end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the attributes hash.
5 6 7 |
# File 'lib/formalist/element/attributes.rb', line 5 def attrs @attrs end |
Instance Method Details
#to_ast ⇒ Array
Returns the attributes as an abstract syntax tree.
17 18 19 |
# File 'lib/formalist/element/attributes.rb', line 17 def to_ast deep_to_ast(deep_simplify(attrs)) end |