Class: Fbtxt::Parser::DateHeader
- Defined in:
- lib/fbtxt/parser/parse_tree.rb
Overview
note - for now exclusive really either date OR year
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date
63 64 65 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 63 def date @date end |
#year ⇒ Object
Returns the value of attribute year
63 64 65 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 63 def year @year end |
Instance Method Details
#as_json ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 65 def as_json(*) h = {} h['date'] = date.as_json if date h['year'] = year.as_json if year ['<DateHeader>', h] end |
#pretty_print(q) ⇒ Object
74 75 76 77 78 79 |
# File 'lib/fbtxt/parser/parse_tree.rb', line 74 def pretty_print( q ) q.group( 4, '<DateHeader ', '>' ) do q.pp( date ) if date q.pp( year ) if year end end |