Class: Multicolor::REST::SearchBuilder
- Inherits:
-
Object
- Object
- Multicolor::REST::SearchBuilder
- Defined in:
- lib/multicolor/rest/search_builder.rb
Instance Attribute Summary collapse
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params, *keys) ⇒ SearchBuilder
constructor
A new instance of SearchBuilder.
- #request ⇒ Object
Constructor Details
#initialize(params, *keys) ⇒ SearchBuilder
Returns a new instance of SearchBuilder.
6 7 8 9 |
# File 'lib/multicolor/rest/search_builder.rb', line 6 def initialize(params, *keys) @params = params @keys = keys.any? ? allowed_params & keys : allowed_params end |
Instance Attribute Details
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
4 5 6 |
# File 'lib/multicolor/rest/search_builder.rb', line 4 def keys @keys end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/multicolor/rest/search_builder.rb', line 4 def params @params end |
Instance Method Details
#request ⇒ Object
11 12 13 14 15 16 |
# File 'lib/multicolor/rest/search_builder.rb', line 11 def request built .merge(Multicolor::Util.build_colors(built.delete(:colors))) .merge(return_metadata: built.delete(:return_metadata).to_json) # son of a bitch .delete_if{ |k,v| v.nil? } end |