Class: Glassnode::RESTv2

Inherits:
Object
  • Object
show all
Includes:
RESTClient, RESTv2Endpoints
Defined in:
lib/rest/v2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RESTv2Endpoints

#endpoints

Methods included from RESTClient

#check_params

Constructor Details

#initialize(args = {}) ⇒ RESTv2

Returns a new instance of RESTv2.



13
14
15
16
17
18
19
20
# File 'lib/rest/v2.rb', line 13

def initialize(args = {})
  self.api_endpoint = args[:url] ? "#{args[:url]}/v2/" : "https://api.glassnode.com/v2/"
  self.proxy = args[:proxy] || nil
  self.debug_connection = false
  self.rest_timeout = 30
  self.rest_open_timeout = 30
  self.api_key = args[:api_key]
end

Instance Attribute Details

#api_endpointObject

Returns the value of attribute api_endpoint.



6
7
8
# File 'lib/rest/v2.rb', line 6

def api_endpoint
  @api_endpoint
end

#api_keyObject

Returns the value of attribute api_key.



8
9
10
# File 'lib/rest/v2.rb', line 8

def api_key
  @api_key
end

#debugObject

Returns the value of attribute debug.



6
7
8
# File 'lib/rest/v2.rb', line 6

def debug
  @debug
end

#debug_connectionObject

Returns the value of attribute debug_connection.



6
7
8
# File 'lib/rest/v2.rb', line 6

def debug_connection
  @debug_connection
end

#proxyObject

Returns the value of attribute proxy.



7
8
9
# File 'lib/rest/v2.rb', line 7

def proxy
  @proxy
end

#rest_open_timeoutObject

Returns the value of attribute rest_open_timeout.



7
8
9
# File 'lib/rest/v2.rb', line 7

def rest_open_timeout
  @rest_open_timeout
end

#rest_timeoutObject

Returns the value of attribute rest_timeout.



7
8
9
# File 'lib/rest/v2.rb', line 7

def rest_timeout
  @rest_timeout
end

Instance Method Details

#configObject



22
23
24
25
26
27
28
29
30
31
# File 'lib/rest/v2.rb', line 22

def config
  {
    :api_endpoint => self.api_endpoint,
    :debug_connection => self.debug_connection,
    :rest_timeout => self.rest_timeout,
    :rest_open_timeout => self.rest_open_timeout,
    :proxy => self.proxy,
    :api_key => self.api_key
  }
end