Class: DnB::Direct::One
- Inherits:
-
Object
- Object
- DnB::Direct::One
- Defined in:
- lib/dnb/direct.rb,
lib/dnb/direct/one.rb
Defined Under Namespace
Modules: Mappings Classes: Company, Content
Constant Summary collapse
- BASE_URL =
'http://dnbdirect-api.dnb.com'.freeze
Class Attribute Summary collapse
-
.api_base_url ⇒ Object
Returns the value of attribute api_base_url.
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.api_secret ⇒ Object
Returns the value of attribute api_secret.
-
.conn ⇒ Object
Returns the value of attribute conn.
-
.token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
Class Attribute Details
.api_base_url ⇒ Object
Returns the value of attribute api_base_url.
9 10 11 |
# File 'lib/dnb/direct/one.rb', line 9 def api_base_url @api_base_url end |
.api_key ⇒ Object
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/dnb/direct/one.rb', line 9 def api_key @api_key end |
.api_secret ⇒ Object
Returns the value of attribute api_secret.
9 10 11 |
# File 'lib/dnb/direct/one.rb', line 9 def api_secret @api_secret end |
.conn ⇒ Object
Returns the value of attribute conn.
9 10 11 |
# File 'lib/dnb/direct/one.rb', line 9 def conn @conn end |
.token ⇒ Object
Returns the value of attribute token.
9 10 11 |
# File 'lib/dnb/direct/one.rb', line 9 def token @token end |
Class Method Details
.connection ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/dnb/direct/one.rb', line 18 def connection @conn ||= Faraday.new() do |faraday| faraday.request :url_encoded # form-encode POST params faraday.response(:logger) if $LOG_DNB faraday.adapter Faraday.default_adapter # make requests with Net::HTTP end end |
.use_credentials(username, password, key) ⇒ Object
11 12 13 14 15 |
# File 'lib/dnb/direct/one.rb', line 11 def use_credentials username, password, key @api_username = username @api_password = password @api_key = key end |