Class: Carriots::ApiMethods::Options
- Inherits:
-
Object
- Object
- Carriots::ApiMethods::Options
- Defined in:
- lib/carriots/api_methods/options.rb
Overview
general options for Carriots API
Direct Known Subclasses
Instance Attribute Summary collapse
-
#build_options ⇒ Object
Returns the value of attribute build_options.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Options
constructor
A new instance of Options.
- #keys ⇒ Object
- #opts_montati ⇒ Object
- #raw ⇒ Object
- #set_options ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Options
Returns a new instance of Options.
13 14 15 16 17 18 |
# File 'lib/carriots/api_methods/options.rb', line 13 def initialize( = {}) @raw_options = @options = [] @build_options = opts_montati end |
Instance Attribute Details
#build_options ⇒ Object
Returns the value of attribute build_options.
11 12 13 |
# File 'lib/carriots/api_methods/options.rb', line 11 def @build_options end |
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/carriots/api_methods/options.rb', line 10 def @options end |
Instance Method Details
#keys ⇒ Object
24 25 26 |
# File 'lib/carriots/api_methods/options.rb', line 24 def keys [] end |
#opts_montati ⇒ Object
32 33 34 35 36 |
# File 'lib/carriots/api_methods/options.rb', line 32 def opts_montati return '' if @options.empty? '?' + @options.join('&') end |
#raw ⇒ Object
20 21 22 |
# File 'lib/carriots/api_methods/options.rb', line 20 def raw @raw_options end |
#set_options ⇒ Object
28 29 30 |
# File 'lib/carriots/api_methods/options.rb', line 28 def keys.each { |key| send("param_#{key}", raw[key]) } end |