Class: UriQueryMerger
- Inherits:
-
Object
- Object
- UriQueryMerger
- Defined in:
- lib/uri_query_merger.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri, params) ⇒ UriQueryMerger
constructor
A new instance of UriQueryMerger.
- #merge ⇒ Object
Constructor Details
#initialize(uri, params) ⇒ UriQueryMerger
Returns a new instance of UriQueryMerger.
5 6 7 8 |
# File 'lib/uri_query_merger.rb', line 5 def initialize(uri, params) @params = params @uri = uri end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/uri_query_merger.rb', line 3 def params @params end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
3 4 5 |
# File 'lib/uri_query_merger.rb', line 3 def uri @uri end |
Instance Method Details
#merge ⇒ Object
10 11 12 13 14 |
# File 'lib/uri_query_merger.rb', line 10 def merge new_uri = URI.parse(uri) new_uri.query = merged_query new_uri.to_s end |