Class: Steamworks::API

Inherits:
Object
  • Object
show all
Defined in:
lib/steamworks/api.rb

Instance Method Summary collapse

Constructor Details

#initializeAPI

Returns a new instance of API.



5
6
7
8
9
10
11
12
13
# File 'lib/steamworks/api.rb', line 5

def initialize
  @partner_conn = Steamworks::Connection.new(gateway: :partner)
  @public_conn = Steamworks::Connection.new(gateway: :public)

  config = Steamworks::Configure
  @key = config.key
  @appid = config.appid
  @identity = config.identity
end

Instance Method Details

#authenticate_user_ticket(ticket: nil) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/steamworks/api.rb', line 21

def authenticate_user_ticket(ticket: nil)
  resp = @partner_conn.get("/ISteamUserAuth/AuthenticateUserTicket/v1/") do |req|
    req.params = {
      key: @key,
      appid: @appid,
      ticket: ticket,
      identity: @identity
    }
  end

  JSON.parse(resp.body)
end