Class: EME::Lootbox

Inherits:
APIConsumer
  • Object
show all
Defined in:
lib/eme/lootbox.rb

Class Method Summary collapse

Class Method Details

.definitions(game_id = nil, conn = connection, opts = {}, reload = false) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/eme/lootbox.rb', line 5

def self.definitions(game_id = nil, conn = connection, opts = {}, reload = false)
  opts[:reload] ||= reload
  opts[:ttl] ||= 900
  path = "/loot_box_definitions"
  path += "?game_id=#{game_id}" if game_id
  return do_request(path, conn, opts)
end

.lootboxes(game_account_id, conn = connection, opts = {}, reload = false) ⇒ Object



13
14
15
16
17
# File 'lib/eme/lootbox.rb', line 13

def self.lootboxes(, conn = connection, opts = {}, reload = false)
  opts[:reload] ||= reload
  opts[:ttl] ||= 1
  return do_request("/loot_boxes?game_account_id=#{game_account_id}", conn, opts)
end

.open(loot_box_id, game_account_id, token, conn = connection, opts = {}, reload = false) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/eme/lootbox.rb', line 19

def self.open(loot_box_id, , token, conn = connection, opts = {}, reload = false)
  opts[:reload] ||= reload
  opts[:method] = :post
  opts[:ttl] ||= 1
  opts[:body] = {id: loot_box_id, game_account_id: , token: token}.to_json
  return do_request("/loot_boxes/open", conn, opts)
end