class Twitch::Games

Attributes

box_art_url[RW]
id[RW]
name[RW]

Public Class Methods

get_by_id(id) click to toggle source
# File lib/twitch/games.rb, line 21
def get_by_id(id)
  response = Twitch.client.get(:helix, "games?id=#{id}")

  new(response["data"][0])
end
get_by_name(name) click to toggle source

Gets Badges for a channel ID

# File lib/twitch/games.rb, line 15
def get_by_name(name)
  response = Twitch.client.get(:helix, "games?name=#{name}")

  new(response["data"][0])
end
get_top() click to toggle source

Gets Top Games

# File lib/twitch/games.rb, line 28
def get_top
  response = Twitch.client.get(:helix, "games/top")

  game_array(response["data"])
end

Private Class Methods

game_array(data) click to toggle source
# File lib/twitch/games.rb, line 36
def game_array(data)
  games = []

  data.each do |g|
    games << new(g)
  end

  games
end

Public Instance Methods

box_art_380() click to toggle source
# File lib/twitch/games.rb, line 8
def box_art_380
  box_art_url.gsub("{width}", "285").gsub("{height}", "380")
end