Class: Relax2::FluentArg
- Inherits:
-
Object
- Object
- Relax2::FluentArg
- Defined in:
- lib/relax2/fluent_arg.rb
Defined Under Namespace
Classes: NameValuePair, ParseResult
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#magic_parameters ⇒ Object
readonly
Returns the value of attribute magic_parameters.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#query_parameters ⇒ Object
readonly
Returns the value of attribute query_parameters.
Instance Method Summary collapse
-
#initialize(args) ⇒ FluentArg
constructor
A new instance of FluentArg.
Constructor Details
#initialize(args) ⇒ FluentArg
Returns a new instance of FluentArg.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/relax2/fluent_arg.rb', line 20 def initialize(args) maybe_http_method, maybe_path_with_query, *maybe_args = args @http_method = validated_http_method_for(maybe_http_method) path_with_query = validated_path_for(maybe_path_with_query) params_and_headers = parse_params_and_headers_from(maybe_args) # Merge query parameters uri = URI.parse(path_with_query) @query_parameters = query_parameters_from(uri) + params_and_headers.query_parameters @path = uri.path @headers = params_and_headers.headers @magic_parameters = validated_magic_parameters_from(params_and_headers.magic_parameters) end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
34 35 36 |
# File 'lib/relax2/fluent_arg.rb', line 34 def headers @headers end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
34 35 36 |
# File 'lib/relax2/fluent_arg.rb', line 34 def http_method @http_method end |
#magic_parameters ⇒ Object (readonly)
Returns the value of attribute magic_parameters.
34 35 36 |
# File 'lib/relax2/fluent_arg.rb', line 34 def magic_parameters @magic_parameters end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
34 35 36 |
# File 'lib/relax2/fluent_arg.rb', line 34 def path @path end |
#query_parameters ⇒ Object (readonly)
Returns the value of attribute query_parameters.
34 35 36 |
# File 'lib/relax2/fluent_arg.rb', line 34 def query_parameters @query_parameters end |