Class: AlchemyAPI::Config
- Inherits:
-
Object
- Object
- AlchemyAPI::Config
- Defined in:
- lib/alchemy-api/config.rb
Class Attribute Summary collapse
-
.apikey ⇒ Object
Returns the value of attribute apikey.
-
.modes ⇒ Object
Returns the value of attribute modes.
Class Method Summary collapse
- .add_mode(key, klass) ⇒ Object
- .default_options ⇒ Object
- .output_mode ⇒ Object
- .output_mode=(value) ⇒ Object
- .valid_output_modes ⇒ Object
Class Attribute Details
.apikey ⇒ Object
Returns the value of attribute apikey.
4 5 6 |
# File 'lib/alchemy-api/config.rb', line 4 def apikey @apikey end |
.modes ⇒ Object
Returns the value of attribute modes.
5 6 7 |
# File 'lib/alchemy-api/config.rb', line 5 def modes @modes end |
Class Method Details
.add_mode(key, klass) ⇒ Object
8 9 10 11 12 |
# File 'lib/alchemy-api/config.rb', line 8 def self.add_mode(key, klass) @modes = {} unless @modes @modes[key] = klass end |
.default_options ⇒ Object
14 15 16 17 18 |
# File 'lib/alchemy-api/config.rb', line 14 def self. { outputMode: output_mode } end |
.output_mode ⇒ Object
20 21 22 |
# File 'lib/alchemy-api/config.rb', line 20 def self.output_mode @output_mode || :json end |
.output_mode=(value) ⇒ Object
24 25 26 27 28 |
# File 'lib/alchemy-api/config.rb', line 24 def self.output_mode=(value) fail InvalidOutputMode unless valid_output_modes.include?(value.to_s) @output_mode = value end |
.valid_output_modes ⇒ Object
30 31 32 |
# File 'lib/alchemy-api/config.rb', line 30 def self.valid_output_modes ['xml', 'json', 'rdf', 'rel-tag', 'rel-tag-raw'] end |