Class: Lushka::Pods
- Inherits:
-
Object
- Object
- Lushka::Pods
- Defined in:
- lib/lushka/pods.rb
Overview
Sources for data extractions class
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize ⇒ Pods
constructor
A new instance of Pods.
- #log_request(request) ⇒ Object
- #show_log ⇒ Object
Constructor Details
#initialize ⇒ Pods
Returns a new instance of Pods.
10 |
# File 'lib/lushka/pods.rb', line 10 def initialize; end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/lushka/pods.rb', line 12 def call(env) query = Rack::Request.new(env) if query.post? request = JSON.parse(query.body.read) response = log_request(request) else response = show_log end body = [response] status = 200 headers = { "content-type" => "application/json" } [status, headers, body] end |