Class: Poms::Configuration
- Inherits:
-
Object
- Object
- Poms::Configuration
- Defined in:
- lib/poms/configuration.rb
Overview
The configuration is a container for configuration values that control the Poms gem.
Constant Summary collapse
- DEFAULT_BASE_URI =
The fallback base URI in case none is explicitly specified.
'https://rs.poms.omroep.nl'.freeze
- REQUIRED_CREDENTIAL_KEYS =
List of special credential keys that need to be present in order to be able to use the API.
[:key, :origin, :secret].freeze
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#key ⇒ Object
Returns the value of attribute key.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#secret ⇒ Object
Returns the value of attribute secret.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Configuration
constructor
Build a new configuration object, including validations and freezing.
Constructor Details
#initialize {|_self| ... } ⇒ Configuration
Build a new configuration object, including validations and freezing.
You probably want to use a block to specify the different configuration options, but when no block is specified, default values will be read from the environment.
22 23 24 25 26 27 28 |
# File 'lib/poms/configuration.rb', line 22 def initialize reset yield self if block_given? validate @credentials = OpenStruct.new(key: key, origin: origin, secret: secret) freeze end |
Instance Attribute Details
#base_uri ⇒ Object
Returns the value of attribute base_uri.
7 8 9 |
# File 'lib/poms/configuration.rb', line 7 def base_uri @base_uri end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
8 9 10 |
# File 'lib/poms/configuration.rb', line 8 def credentials @credentials end |
#key ⇒ Object
Returns the value of attribute key.
7 8 9 |
# File 'lib/poms/configuration.rb', line 7 def key @key end |
#origin ⇒ Object
Returns the value of attribute origin.
7 8 9 |
# File 'lib/poms/configuration.rb', line 7 def origin @origin end |
#secret ⇒ Object
Returns the value of attribute secret.
7 8 9 |
# File 'lib/poms/configuration.rb', line 7 def secret @secret end |