class Freshsales::API
Attributes
debug[RW]
faraday_adapter[RW]
freshsales_apikey[RW]
freshsales_domain[RW]
logger[RW]
proxy[RW]
raw_data[RW]
symbolize_keys[RW]
Public Class Methods
new(opts = {})
click to toggle source
# File lib/freshsales/api.rb, line 7 def initialize(opts = {}) @freshsales_apikey = opts.fetch(:freshsales_apikey, ENV["FRESHSALES_APIKEY"]) @freshsales_domain = opts.fetch(:freshsales_domain, ENV["FRESHSALES_DOMAIN"]) @raw_data = opts.fetch(:raw_data, false) @symbolize_keys = opts.fetch(:symbolize_keys, false) @debug = opts.fetch(:debug, false) @logger = opts.fetch(:logger, ::Logger.new(STDOUT)) @faraday_adapter = opts.fetch(:faraday_adapter, Faraday.default_adapter) @proxy = opts.fetch(:proxy, ENV["FRESHSALES_PROXY"]) @client = Client.new(self) end
Public Instance Methods
method_missing(method, *args)
click to toggle source
rubocop:disable Style/MethodMissing
# File lib/freshsales/api.rb, line 21 def method_missing(method, *args) request = RequestBuilder.new(@client) request.send(method, *args) request end
respond_to_missing?(_method_name, _include_private = false)
click to toggle source
rubocop:enable Style/MethodMissing
# File lib/freshsales/api.rb, line 28 def respond_to_missing?(_method_name, _include_private = false) true end