Class: PryPipeline::Response
- Inherits:
-
Object
- Object
- PryPipeline::Response
- Defined in:
- lib/pry-pipeline/response.rb
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/pry-pipeline/response.rb', line 5 def initialize(response) @response = response end |
Instance Method Details
#to_s ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/pry-pipeline/response.rb', line 9 def to_s case @response when Hash h = @response.to_hash h.keys.map { |key| "#{key} #{h[key]}" }.join("\n") when Array @response.to_a.join("\n") when String, Symbol @response.to_s else @response end end |