Class: Qravan::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/qravan/model.rb

Overview

Models for data extractions class

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#modelsObject

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