Class: Corelogic::Connection
- Inherits:
-
Object
- Object
- Corelogic::Connection
- Defined in:
- lib/corelogic/connection.rb
Constant Summary collapse
- BASE_PATH =
'https://api-prod.corelogic.com/'.freeze
Instance Attribute Summary collapse
-
#bearer_token ⇒ Object
Returns the value of attribute bearer_token.
Instance Method Summary collapse
- #authenticated? ⇒ Boolean
- #get(path, params = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(options = {}) ⇒ Connection
Returns a new instance of Connection.
7 8 9 |
# File 'lib/corelogic/connection.rb', line 7 def initialize( = {}) @bearer_token = [:bearer_token] end |
Instance Attribute Details
#bearer_token ⇒ Object
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
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 |