class Bixby::SignedJsonRequest

Attributes

headers[RW]

Public Class Methods

new(json_request, access_key=nil, secret_key=nil) click to toggle source
# File lib/bixby-common/api/signed_json_request.rb, line 9
def initialize(json_request, access_key=nil, secret_key=nil)
  @operation = json_request.operation
  @params = json_request.params
  @access_key = access_key
  @secret_key = secret_key
  @headers = {}
end

Public Instance Methods

body() click to toggle source
# File lib/bixby-common/api/signed_json_request.rb, line 26
def body
  if @body.nil? then
    hash = { :operation => operation, :params => params }
    @body = MultiJson.dump(hash)
  end
  return @body
end
body=(str) click to toggle source
# File lib/bixby-common/api/signed_json_request.rb, line 22
def body=(str)
  @body = str
end
path() click to toggle source

api-auth requires a path

# File lib/bixby-common/api/signed_json_request.rb, line 18
def path
  "/api"
end
to_wire() click to toggle source
# File lib/bixby-common/api/signed_json_request.rb, line 34
def to_wire
  ApiAuth.sign!(self, @access_key, @secret_key)
  body
end