class AbsorbApi::Base
Public Class Methods
api()
click to toggle source
# File lib/absorb_api/base.rb, line 22 def self.api @api ||= Faraday.new(:url => AbsorbApi.configuration.url, :parallel_manager => Typhoeus::Hydra.new(:max_concurrency => 200)) do |faraday| faraday.request :json faraday.response :json, :content_type => /\bjson$/ faraday.adapter :typhoeus faraday.headers = {"Authorization" => authorize } end end
new(attributes) { |self| ... }
click to toggle source
# File lib/absorb_api/base.rb, line 3 def initialize(attributes, &block) attributes.each do |k,v| instance_variable_set("@#{k.to_s.underscore}", v) unless v.nil? end yield self if block_given? end