Class: SportDb::Parser::GoalCompat

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

Overview

minute and player REQUIRED note - score (e.g. 1-1) is optional goal type is optional e.g. "standalone" (p), (og), etc.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#goal_typeObject

Returns the value of attribute goal_type

Returns:

  • (Object)

    the current value of goal_type



197
198
199
# File 'lib/sportdb/parser/parse_tree-match.rb', line 197

def goal_type
  @goal_type
end

#minuteObject

Returns the value of attribute minute

Returns:

  • (Object)

    the current value of minute



197
198
199
# File 'lib/sportdb/parser/parse_tree-match.rb', line 197

def minute
  @minute
end

#playerObject

Returns the value of attribute player

Returns:

  • (Object)

    the current value of player



197
198
199
# File 'lib/sportdb/parser/parse_tree-match.rb', line 197

def player
  @player
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



197
198
199
# File 'lib/sportdb/parser/parse_tree-match.rb', line 197

def score
  @score
end

Instance Method Details

#pretty_print(q) ⇒ Object



207
208
209
# File 'lib/sportdb/parser/parse_tree-match.rb', line 207

def pretty_print( q )
  q.text( to_s )
end

#to_sObject



198
199
200
201
202
203
204
205
# File 'lib/sportdb/parser/parse_tree-match.rb', line 198

def to_s
  buf = String.new
  buf << "#{minute}"
  buf << " #{player}"
  buf << " #{goal_type}"             if goal_type
  buf << " #{score[0]}-#{score[1]}"  if score
  buf
end