Class: Spid::Rack::Metadata::MetadataEnv
- Inherits:
-
Object
- Object
- Spid::Rack::Metadata::MetadataEnv
- Defined in:
- lib/spid/rack/metadata.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
-
#initialize(env) ⇒ MetadataEnv
constructor
A new instance of MetadataEnv.
- #metadata ⇒ Object
- #response ⇒ Object
- #valid_request? ⇒ Boolean
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
#env ⇒ Object (readonly)
Returns the value of attribute env.
21 22 23 |
# File 'lib/spid/rack/metadata.rb', line 21 def env @env end |
#request ⇒ Object (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
#metadata ⇒ Object
28 29 30 |
# File 'lib/spid/rack/metadata.rb', line 28 def @metadata ||= ::Spid::Metadata.new end |
#response ⇒ Object
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
40 41 42 |
# File 'lib/spid/rack/metadata.rb', line 40 def valid_request? request.path == Spid.configuration. end |