Class: Makeleaps::Request::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/makeleaps/request/base.rb

Direct Known Subclasses

BasicAuth, Generic

Constant Summary collapse

ENDPOINT =
'https://api.makeleaps.com/'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Base

Returns a new instance of Base.



7
8
9
10
11
12
# File 'lib/makeleaps/request/base.rb', line 7

def initialize(&block)
  @connection = Faraday.new(url: ENDPOINT, headers: {'Accept' => 'application/json', 'Content-Type': 'application/json'}) do |conn|
                  conn.adapter  Faraday.default_adapter
                  block.call(conn) if block_given?
                end
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



6
7
8
# File 'lib/makeleaps/request/base.rb', line 6

def connection
  @connection
end