Class: Fbtxt::MatchTree::Round
- Inherits:
-
Object
- Object
- Fbtxt::MatchTree::Round
- Defined in:
- lib/fbtxt/document/match_tree/round.rb
Instance Attribute Summary collapse
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#start_date ⇒ Object
readonly
Returns the value of attribute start_date.
Instance Method Summary collapse
-
#initialize(name:, start_date: nil, end_date: nil, auto: true) ⇒ Round
constructor
A new instance of Round.
- #pretty_print(q) ⇒ Object
Constructor Details
#initialize(name:, start_date: nil, end_date: nil, auto: true) ⇒ Round
Returns a new instance of Round.
9 10 11 12 13 14 15 16 17 |
# File 'lib/fbtxt/document/match_tree/round.rb', line 9 def initialize( name:, start_date: nil, end_date: nil, auto: true ) @name = name @start_date = start_date @end_date = end_date @auto = auto # auto-created (inline reference/header without proper definition before) end |
Instance Attribute Details
#end_date ⇒ Object (readonly)
Returns the value of attribute end_date.
7 8 9 |
# File 'lib/fbtxt/document/match_tree/round.rb', line 7 def end_date @end_date end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/fbtxt/document/match_tree/round.rb', line 7 def name @name end |
#start_date ⇒ Object (readonly)
Returns the value of attribute start_date.
7 8 9 |
# File 'lib/fbtxt/document/match_tree/round.rb', line 7 def start_date @start_date end |
Instance Method Details
#pretty_print(q) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fbtxt/document/match_tree/round.rb', line 19 def pretty_print( q ) ## todo/check - how to display/format key - use () or not - why? why not? q.group( 4, '<Round', '>') do ## group( indent, open, close) q.text( " AUTO" ) if @auto q.text( " #{@name}" ) if @start_date q.text( " : #{@start_date}" ) q.text( " - #{@end_date}" ) if @start_date != @end_date end end end |