Module: Reuters::Credentials
- Defined in:
- lib/reuters/credentials.rb
Overview
The Credentials module handles storing the configured credentials for the Reuters gem.
Class Attribute Summary collapse
-
.app_id ⇒ String, Nil
The application ID to use for all requests to the Reuter’s API.
-
.password ⇒ String, Nil
The password to use to authenticate against the Reuter’s API with.
-
.username ⇒ String, Nil
The username to use to authenticate against the Reuter’s API with.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Object
Enables credentials to be configured by passing in itself as a block which enables static variables to be set.
-
.details {|username, password, app_id| ... } ⇒ Object
Yields the configured credentials to connect to the Reuter’s API with.
-
.to_h ⇒ Hash
Returns credentials that have been configured as a Hash.
Class Attribute Details
.app_id ⇒ String, Nil
The application ID to use for all requests to the Reuter’s API.
40 |
# File 'lib/reuters/credentials.rb', line 40 mattr_accessor :username |
.password ⇒ String, Nil
The password to use to authenticate against the Reuter’s API with.
|
# File 'lib/reuters/credentials.rb', line 26
|
.username ⇒ String, Nil
The username to use to authenticate against the Reuter’s API with.
|
# File 'lib/reuters/credentials.rb', line 19
|
Class Method Details
.configure {|config| ... } ⇒ Object
Enables credentials to be configured by passing in itself as a block which enables static variables to be set.
73 74 75 |
# File 'lib/reuters/credentials.rb', line 73 def self.configure yield self end |
.details {|username, password, app_id| ... } ⇒ Object
Yields the configured credentials to connect to the Reuter’s API with.
57 58 59 |
# File 'lib/reuters/credentials.rb', line 57 def self.details yield @@username, @@password, @@app_id end |
.to_h ⇒ Hash
Returns credentials that have been configured as a Hash.
64 65 66 |
# File 'lib/reuters/credentials.rb', line 64 def self.to_h { username: username, password: password, app_id: app_id } end |