Sha256: c0320eb2c5486afeb6a5cd1b738c093fdf6bcf6e04f3d1077a328ee275196101

Contents?: true

Size: 440 Bytes

Versions: 1

Compression:

Stored size: 440 Bytes

Contents

class GameLockerAPI
  class Telemetry
    attr_accessor :events
    Event = Struct.new(:time, :type, :payload)
    def initialize(telemetry_url)
      @events  = []
      response = RestClient.get(telemetry_url)
      parse(response.body)

      return self
    end

    def parse(json)
      Oj.load(json).each do |event|
        @events << Event.new(Time.parse(event['time']), event['type'], event['payload'])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamelocker_api-0.1.3 lib/gamelocker_api/telemetry.rb