Class: Restspec::Endpoints::URLBuilder
- Inherits:
-
Object
- Object
- Restspec::Endpoints::URLBuilder
- Defined in:
- lib/restspec/endpoints/url_builder.rb
Constant Summary collapse
- PARAM_INTERPOLATION_REGEX =
/:([\w]+)/
Instance Attribute Summary collapse
-
#url_params ⇒ Object
readonly
Returns the value of attribute url_params.
Instance Method Summary collapse
- #full_url ⇒ Object
-
#initialize(path = '', url_params = {}, query_params = {}) ⇒ URLBuilder
constructor
A new instance of URLBuilder.
Constructor Details
#initialize(path = '', url_params = {}, query_params = {}) ⇒ URLBuilder
Returns a new instance of URLBuilder.
8 9 10 11 12 |
# File 'lib/restspec/endpoints/url_builder.rb', line 8 def initialize(path = '', url_params = {}, query_params = {}) self.path = path self.url_params = unbox_url_params(url_params) self.query_params = query_params end |
Instance Attribute Details
#url_params ⇒ Object
Returns the value of attribute url_params.
4 5 6 |
# File 'lib/restspec/endpoints/url_builder.rb', line 4 def url_params @url_params end |
Instance Method Details
#full_url ⇒ Object
14 15 16 |
# File 'lib/restspec/endpoints/url_builder.rb', line 14 def full_url base_url + path_from_params + query_string end |