Class: Eyeofsatoshi::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/eyeofsatoshi.rb

Direct Known Subclasses

Coinbase, Coincap, Coingecko, Coinpaprika, Cryptocompare

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Base

Returns a new instance of Base.



11
12
13
# File 'lib/eyeofsatoshi.rb', line 11

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/eyeofsatoshi.rb', line 9

def options
  @options
end

Instance Method Details

#parsed_response(response) ⇒ Object



20
21
22
# File 'lib/eyeofsatoshi.rb', line 20

def parsed_response(response)
  "#{__method__}"
end

#request(type, url, opts = {}) ⇒ Object



14
15
16
17
18
# File 'lib/eyeofsatoshi.rb', line 14

def request(type, url, opts = {})
  HTTParty
    .send(type, url, opts)
    .yield_self { |response| parsed_response(response) }
end