Class: PlayStationNetworkAPI::Entitlement

Inherits:
Client
  • Object
show all
Defined in:
lib/play_station_network_api/entitlement.rb

Instance Attribute Summary

Attributes inherited from Client

#account_id, #age, #country, #default_headers, #language, #refresh_token

Instance Method Summary collapse

Methods inherited from Client

#catalog, #explore, #game, #get_account_devices, #get_account_id, #initialize, #search, #session, #trophy, #user

Constructor Details

This class inherits a constructor from PlayStationNetworkAPI::Client

Instance Method Details

#entitlement(entitlement_id) ⇒ Object

entitlement_id [String]



22
23
24
25
# File 'lib/play_station_network_api/entitlement.rb', line 22

def entitlement(entitlement_id)
  # https://m.np.playstation.net/api/entitlement/v2/users/me/internal/entitlements/EP0700-NPEB90430_00-RRUDEMOEU0000100
  get([path, entitlement_id].join('/').parsed_response)
end

#entitlements(offset: 0, limit: 500) ⇒ Object

offset [Integer] limit [Integer]

min: 1,
max: 500



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/play_station_network_api/entitlement.rb', line 9

def entitlements(offset: 0, limit: 500)
  raise 'limit must be less than or equal to 500' if limit > 500

  # https://m.np.playstation.net/api/entitlement/v2/users/me/internal/entitlements
  get(path,
    query: {
      limit: limit,
      offset: offset
    }
  ).parsed_response
end