Module: Rack::AMF::Environment
- Defined in:
- lib/rack/amf/environment.rb
Class Attribute Summary collapse
-
.debug ⇒ Object
Returns the value of attribute debug.
-
.mode ⇒ Object
Returns the value of attribute mode.
-
.services ⇒ Object
Returns the value of attribute services.
-
.url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
-
.log(data) ⇒ Object
:nodoc:.
-
.populate(options = {}) ⇒ Object
Populates the environment from the given options hash, which was passed in through rack.
-
.register_service(path, service) ⇒ Object
Used to register a service for use with the ServiceManager middleware.
Class Attribute Details
.debug ⇒ Object
Returns the value of attribute debug.
4 5 6 |
# File 'lib/rack/amf/environment.rb', line 4 def debug @debug end |
.mode ⇒ Object
Returns the value of attribute mode.
4 5 6 |
# File 'lib/rack/amf/environment.rb', line 4 def mode @mode end |
.services ⇒ Object
Returns the value of attribute services.
4 5 6 |
# File 'lib/rack/amf/environment.rb', line 4 def services @services end |
.url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/rack/amf/environment.rb', line 4 def url @url end |
Class Method Details
.log(data) ⇒ Object
:nodoc:
28 29 30 31 |
# File 'lib/rack/amf/environment.rb', line 28 def log data #:nodoc: return if !debug puts data end |
.populate(options = {}) ⇒ Object
Populates the environment from the given options hash, which was passed in through rack
22 23 24 25 26 |
# File 'lib/rack/amf/environment.rb', line 22 def populate ={} #:nodoc: url = [:url] if .key?(:url) debug = [:debug] if .key?(:debug) mode = [:mode] if .key?(:mode) end |
.register_service(path, service) ⇒ Object
Used to register a service for use with the ServiceManager middleware. To register a service, simply pass in the root path for the service and an object that can receive service calls.
Example:
Rack::AMF::Environment.register_service 'SpecialService', SpecialService.new
Rack::AMF::Environment.register_service 'org.rack-amf.AMFService', AMFService.new
15 16 17 18 |
# File 'lib/rack/amf/environment.rb', line 15 def register_service path, service @services ||= {} @services[path] = service end |