Class: Makeleaps::Request::Base
- Inherits:
-
Object
- Object
- Makeleaps::Request::Base
- Defined in:
- lib/makeleaps/request/base.rb
Constant Summary collapse
- ENDPOINT =
'https://api.makeleaps.com/'
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Base
constructor
A new instance of Base.
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
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
6 7 8 |
# File 'lib/makeleaps/request/base.rb', line 6 def connection @connection end |