Class: Horseman::Action
- Inherits:
-
Object
- Object
- Horseman::Action
- Defined in:
- lib/horseman/action.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri, response = nil) ⇒ Action
constructor
A new instance of Action.
- #relative_root ⇒ Object
- #url ⇒ Object
Constructor Details
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/horseman/action.rb', line 5 def response @response end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
5 6 7 |
# File 'lib/horseman/action.rb', line 5 def uri @uri end |
Instance Method Details
#relative_root ⇒ Object
16 17 18 |
# File 'lib/horseman/action.rb', line 16 def relative_root "#{url.rpartition('/')[0]}/" end |
#url ⇒ Object
12 13 14 |
# File 'lib/horseman/action.rb', line 12 def url "#{@uri.scheme}://#{@uri.host}#{@uri.path}" + (@uri.query ? "?#{@uri.query}" : "") end |