class Layer::Client::Platform
Attributes
app_id[R]
token[R]
Public Class Methods
new(app_id = Layer::Client.app_id, token = Layer::Client.token)
click to toggle source
# File lib/layer/client/platform.rb, line 7 def initialize(app_id = Layer::Client.app_id, token = Layer::Client.token) @app_id = self.class.normalize_id(app_id) @token = token end
Private Instance Methods
request(method, url, payload = {}, headers = {})
click to toggle source
Calls superclass method
Layer::Client#request
# File lib/layer/client/platform.rb, line 14 def request(method, url, payload = {}, headers = {}) url = "https://api.layer.com/apps/#{app_id}#{url}" unless url.start_with?('https://api.layer.com') headers['Accept'] ||= 'application/vnd.layer+json; version=1.1' headers['Authorization'] ||= "Bearer #{token}" super end