Class: Alephant::Broker::Environment
- Inherits:
-
Object
- Object
- Alephant::Broker::Environment
- Includes:
- Logger
- Defined in:
- lib/alephant/broker/environment.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #data ⇒ Object
- #get? ⇒ Boolean
- #if_modified_since ⇒ Object
- #if_none_match ⇒ Object
-
#initialize(env) ⇒ Environment
constructor
A new instance of Environment.
- #method ⇒ Object
- #options ⇒ Object
- #options? ⇒ Boolean
- #path ⇒ Object
- #post? ⇒ Boolean
- #query ⇒ Object
Constructor Details
#initialize(env) ⇒ Environment
Returns a new instance of Environment.
11 12 13 |
# File 'lib/alephant/broker/environment.rb', line 11 def initialize(env) @settings = env end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
9 10 11 |
# File 'lib/alephant/broker/environment.rb', line 9 def settings @settings end |
Instance Method Details
#data ⇒ Object
47 48 49 |
# File 'lib/alephant/broker/environment.rb', line 47 def data parse(rack_input) if post? end |
#get? ⇒ Boolean
23 24 25 |
# File 'lib/alephant/broker/environment.rb', line 23 def get? settings["REQUEST_METHOD"] == "GET" end |
#if_modified_since ⇒ Object
43 44 45 |
# File 'lib/alephant/broker/environment.rb', line 43 def if_modified_since settings["HTTP_IF_MODIFIED_SINCE"] end |
#if_none_match ⇒ Object
39 40 41 |
# File 'lib/alephant/broker/environment.rb', line 39 def if_none_match settings["HTTP_IF_NONE_MATCH"] end |
#method ⇒ Object
15 16 17 |
# File 'lib/alephant/broker/environment.rb', line 15 def method settings["REQUEST_METHOD"] end |
#options ⇒ Object
51 52 53 |
# File 'lib/alephant/broker/environment.rb', line 51 def Rack::Utils.parse_nested_query query end |
#options? ⇒ Boolean
27 28 29 |
# File 'lib/alephant/broker/environment.rb', line 27 def settings["REQUEST_METHOD"] == "OPTIONS" end |
#path ⇒ Object
35 36 37 |
# File 'lib/alephant/broker/environment.rb', line 35 def path settings["PATH_INFO"] end |
#post? ⇒ Boolean
19 20 21 |
# File 'lib/alephant/broker/environment.rb', line 19 def post? settings["REQUEST_METHOD"] == "POST" end |
#query ⇒ Object
31 32 33 |
# File 'lib/alephant/broker/environment.rb', line 31 def query settings["QUERY_STRING"] || "" end |