Class: HereOrThere::Response
- Inherits:
-
Object
- Object
- HereOrThere::Response
- Defined in:
- lib/here_or_there/response.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(stdout, stderr, status) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(stdout, stderr, status) ⇒ Response
Returns a new instance of Response.
5 6 7 8 9 |
# File 'lib/here_or_there/response.rb', line 5 def initialize stdout, stderr, status @stdout = stdout @stderr = stderr @status = status end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/here_or_there/response.rb', line 3 def status @status end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
3 4 5 |
# File 'lib/here_or_there/response.rb', line 3 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
3 4 5 |
# File 'lib/here_or_there/response.rb', line 3 def stdout @stdout end |
Instance Method Details
#[](key) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/here_or_there/response.rb', line 11 def [] key case key when 0 then stdout when 1 then stderr when 2 then status else nil end end |
#success? ⇒ Boolean
21 22 23 24 25 26 27 |
# File 'lib/here_or_there/response.rb', line 21 def success? if status.respond_to? :success? status.success? else status end end |