Class: MagicResource::PathWithHttpVerb
- Inherits:
-
String
- Object
- String
- MagicResource::PathWithHttpVerb
- Defined in:
- lib/magic-resource/path_with_http_verb.rb
Instance Attribute Summary collapse
-
#http_verb ⇒ Object
readonly
Returns the value of attribute http_verb.
Instance Method Summary collapse
-
#initialize(http_verb, path) ⇒ PathWithHttpVerb
constructor
A new instance of PathWithHttpVerb.
Constructor Details
#initialize(http_verb, path) ⇒ PathWithHttpVerb
Returns a new instance of PathWithHttpVerb.
5 6 7 8 9 10 11 |
# File 'lib/magic-resource/path_with_http_verb.rb', line 5 def initialize(http_verb, path) @http_verb = http_verb.kind_of?(self.class) ? http_verb.http_verb : http_verb.source.scan(/\w+/).first.try(:downcase).try(:to_sym) super(path) end |
Instance Attribute Details
#http_verb ⇒ Object (readonly)
Returns the value of attribute http_verb.
3 4 5 |
# File 'lib/magic-resource/path_with_http_verb.rb', line 3 def http_verb @http_verb end |