class Sendcloud::Base
Attributes
api_key[RW]
api_secret[RW]
Public Class Methods
new(api_key, api_secret)
click to toggle source
@param api_key
[String] the `apikey` from your account settings @param api_secret
[String] the `apisecret` from your account settings
# File lib/sendcloud/base.rb, line 14 def initialize(api_key, api_secret) self.api_key = api_key self.api_secret = api_secret end
Public Instance Methods
auth()
click to toggle source
get the auth hash to use for all the requests since the sendcloud api uses basic authentication it will be used in the subclasses like this: `HTTParty.get(“twitter.com/statuses/public_timeline.json”, :basic_auth => auth)`
@return [Hash] the basic auth hash based on the api_key
and api_secret
# File lib/sendcloud/base.rb, line 25 def auth { username: api_key, password: api_secret} end