Class: Fbtxt::Parser::DateHeaderLegs

Inherits:
Struct
  • Object
show all
Defined in:
lib/fbtxt/parser/parse_tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#date1Object

Returns the value of attribute date1

Returns:

  • (Object)

    the current value of date1



84
85
86
# File 'lib/fbtxt/parser/parse_tree.rb', line 84

def date1
  @date1
end

#date2Object

Returns the value of attribute date2

Returns:

  • (Object)

    the current value of date2



84
85
86
# File 'lib/fbtxt/parser/parse_tree.rb', line 84

def date2
  @date2
end

Instance Method Details

#as_jsonObject



86
87
88
89
90
91
# File 'lib/fbtxt/parser/parse_tree.rb', line 86

def as_json(*)
  ['<DateHeaderLegs>', { 'leg1' => date1.as_json,
                         'leg2' => date2.as_json,
                       }
  ]
end

#pretty_print(q) ⇒ Object



93
94
95
96
97
98
99
100
# File 'lib/fbtxt/parser/parse_tree.rb', line 93

def pretty_print( q )
  q.group( 4, '<DateHeaderLegs ', '>' ) do
    q.text( "leg1=" )
    q.pp( date1 )
    q.text( " leg2=" )
    q.pp( date2 )
  end
end