Class: Qravan::Model
- Inherits:
-
Object
- Object
- Qravan::Model
- Defined in:
- lib/qravan/model.rb
Overview
Models for data extractions class
Instance Attribute Summary collapse
-
#models ⇒ Object
Returns the value of attribute models.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(cargo = {}) ⇒ Model
constructor
A new instance of Model.
Constructor Details
#initialize(cargo = {}) ⇒ Model
Returns a new instance of Model.
8 9 10 |
# File 'lib/qravan/model.rb', line 8 def initialize(cargo = {}) @models ||= cargo.models end |
Instance Attribute Details
#models ⇒ Object
Returns the value of attribute models.
6 7 8 |
# File 'lib/qravan/model.rb', line 6 def models @models end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/qravan/model.rb', line 12 def call(env) body = [models.to_json] status = 200 headers = { "content-type" => "application/json" } [status, headers, body] end |