Class: Starcraft2::Profile::Match

Inherits:
Object
  • Object
show all
Defined in:
lib/starcraft2/profile/match.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Match

Returns a new instance of Match.



6
7
8
# File 'lib/starcraft2/profile/match.rb', line 6

def initialize(options = {})
  Utils.load(self, options)
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



4
5
6
# File 'lib/starcraft2/profile/match.rb', line 4

def date
  @date
end

#decisionObject

Returns the value of attribute decision.



4
5
6
# File 'lib/starcraft2/profile/match.rb', line 4

def decision
  @decision
end

#mapObject

Returns the value of attribute map.



4
5
6
# File 'lib/starcraft2/profile/match.rb', line 4

def map
  @map
end

#speedObject

Returns the value of attribute speed.



4
5
6
# File 'lib/starcraft2/profile/match.rb', line 4

def speed
  @speed
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/starcraft2/profile/match.rb', line 4

def type
  @type
end

Class Method Details

.build(match_json) ⇒ Object



10
11
12
13
14
15
# File 'lib/starcraft2/profile/match.rb', line 10

def self.build(match_json)
  data = JSON.parse(match_json)
  data['matches'].map do |m|
    new(m)
  end
end