Class: Lookbook::SearchParamEncoder
- Defined in:
- lib/lookbook/services/urls/search_param_encoder.rb
Instance Attribute Summary collapse
- #data ⇒ Object readonly
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(data) ⇒ SearchParamEncoder
constructor
A new instance of SearchParamEncoder.
Methods inherited from Service
Constructor Details
#initialize(data) ⇒ SearchParamEncoder
Returns a new instance of SearchParamEncoder.
7 8 9 |
# File 'lib/lookbook/services/urls/search_param_encoder.rb', line 7 def initialize(data) @data = data.to_h end |
Instance Attribute Details
#data ⇒ Object (readonly)
5 6 7 |
# File 'lib/lookbook/services/urls/search_param_encoder.rb', line 5 def data @data end |
Instance Method Details
#call ⇒ Object
11 12 13 14 |
# File 'lib/lookbook/services/urls/search_param_encoder.rb', line 11 def call json = JSON.generate(data) CGI.escape(json) end |