Class: SportDb::Parser::GroupDef

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



10
11
12
# File 'lib/sportdb/parser/parse_tree.rb', line 10

def name
  @name
end

#teamsObject

Returns the value of attribute teams

Returns:

  • (Object)

    the current value of teams



10
11
12
# File 'lib/sportdb/parser/parse_tree.rb', line 10

def teams
  @teams
end

Instance Method Details

#as_jsonObject



12
13
14
15
16
# File 'lib/sportdb/parser/parse_tree.rb', line 12

def as_json(*)
  ["<GroupDef>", { 'name'   => name.as_json,
                   'teams'  => teams.as_json }
  ]
end

#pretty_print(q) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/sportdb/parser/parse_tree.rb', line 18

def pretty_print( q )
  q.group( 4, '<GroupDef ', '>' ) do        ##  group( indent, open, close)
    q.text( name )
    q.text( " teams=" )
    q.pp( teams )
  end
end