Class: Qravan::Spec

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.collect_specObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/qravan/version.rb', line 18

def collect_spec
  {
    "spec": {
      "server": {
        "type": "Qravan Server",
        "version": Qravan::VERSION,
        "env": Qravan::ENV
      },
      "protocol": {
        "type": "Qravan Spec",
        "version": "1.0"
      }
    }
  }
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/qravan/version.rb', line 9

def call(env)
  body = [Qravan::Spec.collect_spec.to_json]
  status  = 200
  headers = { "content-type" => "application/json" }

  [status, headers, body]
end