class PlaylyfeClient::V2::StateMetric

Attributes

states[R]

Public Class Methods

new(metric_hash, game) click to toggle source
Calls superclass method PlaylyfeClient::V2::Metric::new
# File lib/playlyfe_client/v2/metric/state_metric.rb, line 10
def initialize(metric_hash, game)
  super(metric_hash, game)

  fill_states(metric_hash["states"])
end

Private Instance Methods

fill_states(states_hash) click to toggle source
# File lib/playlyfe_client/v2/metric/state_metric.rb, line 17
def fill_states(states_hash)
  @states=[]
  states_hash.each_pair do |key, value|
    @states << {name: key , description: value["description"]}
  end
  @states
end