Class: Parser::ParsedElement
- Inherits:
-
Struct
- Object
- Struct
- Parser::ParsedElement
- Defined in:
- lib/appswarm/tools/parser/parser_lib.rb,
lib/appswarm/tools/parser/parser_lib.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
20 21 22 |
# File 'lib/appswarm/tools/parser/parser_lib.rb', line 20 def block @block end |
#type ⇒ Object
Returns the value of attribute type
20 21 22 |
# File 'lib/appswarm/tools/parser/parser_lib.rb', line 20 def type @type end |
#value ⇒ Object
Returns the value of attribute value
20 21 22 |
# File 'lib/appswarm/tools/parser/parser_lib.rb', line 20 def value @value end |
Instance Method Details
#convert ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/appswarm/tools/parser/parser_lib.rb', line 27 def convert if block instance_eval(&block) else if value.is_a?(Array) if value.length>1 value.map{|v|v.convert} else value[0].convert end else value end end end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/appswarm/tools/parser/parser_lib.rb', line 23 def to_s "[#{type} #{value}]" end |