Module: Drymm::Shapes::ASTMethods
Overview
AST-related methods mixin
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#compile ⇒ Object
Compile an instance back to original object.
-
#to_ast ⇒ Array
Fold data back into the plain AST.
Instance Method Details
#compile ⇒ Object
Compile an instance back to original object
22 23 24 |
# File 'lib/drymm/shapes/ast_methods.rb', line 22 def compile self.class.compiler.call([to_ast])[0] end |
#to_ast ⇒ Array
Fold data back into the plain AST
11 12 13 14 15 16 |
# File 'lib/drymm/shapes/ast_methods.rb', line 11 def to_ast type, *node = attributes.values_at(*self.class.keys_order) node = recursive_ast(node) node = node[0] if node.size == 1 [type, node] end |