Class: Spid::Rack::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/spid/rack/metadata.rb

Overview

:nodoc:

Defined Under Namespace

Classes: MetadataEnv

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Metadata

Returns a new instance of Metadata.



8
9
10
# File 'lib/spid/rack/metadata.rb', line 8

def initialize(app)
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



6
7
8
# File 'lib/spid/rack/metadata.rb', line 6

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/spid/rack/metadata.rb', line 12

def call(env)
  @metadata = MetadataEnv.new(env)

  return @metadata.response if @metadata.valid_request?

  app.call(env)
end