Class: Spid::Rack::Metadata::MetadataEnv

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

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ MetadataEnv

Returns a new instance of MetadataEnv.



23
24
25
26
# File 'lib/spid/rack/metadata.rb', line 23

def initialize(env)
  @env = env
  @request = ::Rack::Request.new(env)
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



21
22
23
# File 'lib/spid/rack/metadata.rb', line 21

def env
  @env
end

#requestObject (readonly)

Returns the value of attribute request.



21
22
23
# File 'lib/spid/rack/metadata.rb', line 21

def request
  @request
end

Instance Method Details

#metadataObject



28
29
30
# File 'lib/spid/rack/metadata.rb', line 28

def 
  @metadata ||= ::Spid::Metadata.new
end

#responseObject



32
33
34
35
36
37
38
# File 'lib/spid/rack/metadata.rb', line 32

def response
  [
    200,
    { "Content-Type" => "application/xml" },
    [.to_xml]
  ]
end

#valid_request?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/spid/rack/metadata.rb', line 40

def valid_request?
  request.path == Spid.configuration.
end