Class: Panko::Response
- Inherits:
-
Object
- Object
- Panko::Response
- Defined in:
- lib/panko/response.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Response
constructor
A new instance of Response.
- #to_json(_options = nil) ⇒ Object
Constructor Details
#initialize(data) ⇒ Response
Returns a new instance of Response.
36 37 38 |
# File 'lib/panko/response.rb', line 36 def initialize(data) @data = data end |
Class Method Details
.create ⇒ Object
46 47 48 |
# File 'lib/panko/response.rb', line 46 def self.create Response.new(yield ResponseCreator) end |
Instance Method Details
#to_json(_options = nil) ⇒ Object
40 41 42 43 44 |
# File 'lib/panko/response.rb', line 40 def to_json( = nil) writer = Oj::StringWriter.new(mode: :rails) write(writer, @data) writer.to_s end |