Class: Alchemrest::UrlBuilder::Options
- Inherits:
-
Object
- Object
- Alchemrest::UrlBuilder::Options
- Defined in:
- lib/alchemrest/url_builder/options.rb
Constant Summary collapse
- InvalidEncoderError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#query ⇒ Object
Returns the value of attribute query.
-
#query_param_encoder ⇒ Object
readonly
Returns the value of attribute query_param_encoder.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
Instance Attribute Details
#query ⇒ Object
Returns the value of attribute query.
7 8 9 |
# File 'lib/alchemrest/url_builder/options.rb', line 7 def query @query end |
#query_param_encoder ⇒ Object (readonly)
Returns the value of attribute query_param_encoder.
9 10 11 |
# File 'lib/alchemrest/url_builder/options.rb', line 9 def query_param_encoder @query_param_encoder end |
#values ⇒ Object
Returns the value of attribute values.
7 8 9 |
# File 'lib/alchemrest/url_builder/options.rb', line 7 def values @values end |
Instance Method Details
#create_builder(template:) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/alchemrest/url_builder/options.rb', line 23 def create_builder(template:) UrlBuilder.new( template:, query: query, values: values, query_param_encoder: query_param_encoder, ) end |
#encode_query_with ⇒ Object
19 20 21 |
# File 'lib/alchemrest/url_builder/options.rb', line 19 def encode_query_with(&) @query_param_encoder = Encoders::Custom.new(&) end |
#encode_query_with=(name) ⇒ Object
13 14 15 16 17 |
# File 'lib/alchemrest/url_builder/options.rb', line 13 def encode_query_with=(name) @query_param_encoder = Encoders.find(name) rescue NoMatchingPatternError raise InvalidEncoderError, ":#{name} is not a known query string encoder type. Known types are :rack and :form" end |