Class: Corelogic::Connection

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

Constant Summary collapse

BASE_PATH =
'https://api-prod.corelogic.com/'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Connection

Returns a new instance of Connection.



7
8
9
# File 'lib/corelogic/connection.rb', line 7

def initialize(options = {})
  @bearer_token = options[:bearer_token]
end

Instance Attribute Details

#bearer_tokenObject

Returns the value of attribute bearer_token.



5
6
7
# File 'lib/corelogic/connection.rb', line 5

def bearer_token
  @bearer_token
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/corelogic/connection.rb', line 17

def authenticated?
  !(bearer_token.nil? || bearer_token.empty?)
end

#get(path, params = {}) ⇒ Object



13
14
15
# File 'lib/corelogic/connection.rb', line 13

def get(path, params = {})
  HTTP.auth(bearer_auth_header).get(url(path), params)
end