Class: Fbtxt::Parser::RoundDef
- Defined in:
- lib/fbtxt/parser/parse_tree.rb
Overview
note - for now exclusive really either date OR duration
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date
32 33 34 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 32 def date @date end |
#duration ⇒ Object
Returns the value of attribute duration
32 33 34 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 32 def duration @duration end |
#name ⇒ Object
Returns the value of attribute name
32 33 34 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 32 def name @name end |
Instance Method Details
#as_json ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 34 def as_json(*) h = { 'name' => name.as_json } h['date'] = date.as_json if date h['duration'] = duration.as_json if duration ["<RoundDef>", h] end |
#pretty_print(q) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 43 def pretty_print( q ) q.group( 4, '<RoundDef ', '>' ) do q.text( name ) if date q.text( " date=") q.pp( date ) end if duration q.text( " duration=") q.pp( duration ) end end end |