class FootballApi::Card
Constants
- TYPE
Attributes
minute[RW]
player[RW]
type[RW]
Public Class Methods
new(hash = {})
click to toggle source
# File lib/football_api/card.rb, line 7 def initialize(hash = {}) return {} unless TYPE.include?(hash[:type]) @type = hash[:type] @minute = hash[:minute] @player = parse_player(hash) end
Public Instance Methods
parse_player(hash = {})
click to toggle source
# File lib/football_api/card.rb, line 15 def parse_player(hash = {}) FootballApi::Player.new(hash) end