Class: Iprofiler::Client
- Inherits:
-
Object
- Object
- Iprofiler::Client
- Includes:
- Api::QueryMethods
- Defined in:
- lib/iprofiler/client.rb
Constant Summary collapse
- CONNECTION_PARAMETERS =
[:api_key, :api_secret, :api_host]
Instance Attribute Summary collapse
-
#api_host ⇒ Object
readonly
Returns the value of attribute api_host.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#api_secret ⇒ Object
readonly
Returns the value of attribute api_secret.
-
#missing_credentials ⇒ Object
readonly
Returns the value of attribute missing_credentials.
Instance Method Summary collapse
-
#initialize(api_key = Iprofiler.api_key, api_secret = Iprofiler.api_secret, api_host = Iprofiler.api_host) ⇒ Client
constructor
A new instance of Client.
- #valid_credentials? ⇒ Boolean
Methods included from Api::QueryMethods
Constructor Details
#initialize(api_key = Iprofiler.api_key, api_secret = Iprofiler.api_secret, api_host = Iprofiler.api_host) ⇒ Client
Returns a new instance of Client.
23 24 25 26 27 28 |
# File 'lib/iprofiler/client.rb', line 23 def initialize(api_key=Iprofiler.api_key, api_secret=Iprofiler.api_secret, api_host=Iprofiler.api_host) @api_key = api_key @api_secret = api_secret @api_host = api_host validate_credential_presence end |
Instance Attribute Details
#api_host ⇒ Object (readonly)
Returns the value of attribute api_host.
13 14 15 |
# File 'lib/iprofiler/client.rb', line 13 def api_host @api_host end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
13 14 15 |
# File 'lib/iprofiler/client.rb', line 13 def api_key @api_key end |
#api_secret ⇒ Object (readonly)
Returns the value of attribute api_secret.
13 14 15 |
# File 'lib/iprofiler/client.rb', line 13 def api_secret @api_secret end |
#missing_credentials ⇒ Object (readonly)
Returns the value of attribute missing_credentials.
13 14 15 |
# File 'lib/iprofiler/client.rb', line 13 def missing_credentials @missing_credentials end |
Instance Method Details
#valid_credentials? ⇒ Boolean
30 31 32 |
# File 'lib/iprofiler/client.rb', line 30 def valid_credentials? credentials_present? && (company_lookup({}).code == 200) end |