Class: Veye::API::Resource

Inherits:
BaseResource show all
Defined in:
lib/veye/api/resource.rb

Instance Attribute Summary

Attributes inherited from BaseResource

#full_path, #resource

Instance Method Summary collapse

Methods inherited from BaseResource

build_url

Constructor Details

#initialize(path = nil) ⇒ Resource

Returns a new instance of Resource.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/veye/api/resource.rb', line 7

def initialize(path = nil)
  super(path)
  timeout_val = $global_options[:timeout].to_i
  timeout = timeout_val if timeout_val > 0
  timeout ||= 90
  open_timeout = $global_options[:open_timeout].to_i || 10

  @resource = RestClient::Resource.new(
    @full_path,
    timeout: timeout,
    open_timeout: open_timeout,
  )
end