Class: Esplanade::Response::Doc
- Inherits:
-
Object
- Object
- Esplanade::Response::Doc
- Defined in:
- lib/esplanade/response/doc.rb
Instance Method Summary collapse
-
#initialize(request, raw) ⇒ Doc
constructor
A new instance of Doc.
- #json_schemas ⇒ Object
- #status ⇒ Object
- #tomogram ⇒ Object
Constructor Details
#initialize(request, raw) ⇒ Doc
4 5 6 7 |
# File 'lib/esplanade/response/doc.rb', line 4 def initialize(request, raw) @request = request @raw = raw end |
Instance Method Details
#json_schemas ⇒ Object
16 17 18 |
# File 'lib/esplanade/response/doc.rb', line 16 def json_schemas @json_schemas ||= tomogram.map { |action| action['body'] } end |
#status ⇒ Object
20 21 22 |
# File 'lib/esplanade/response/doc.rb', line 20 def status @status ||= tomogram['status'] end |
#tomogram ⇒ Object
9 10 11 12 13 14 |
# File 'lib/esplanade/response/doc.rb', line 9 def tomogram @tomogram ||= @request.doc.responses.find_all { |response| response['status'] == @raw.status } raise NotDocumented.new(**) if @tomogram == [] @tomogram end |