Class: Request
- Inherits:
-
Object
- Object
- Request
- Defined in:
- lib/request.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#variables ⇒ Object
Returns the value of attribute variables.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(hash) ⇒ Request
Returns a new instance of Request.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/request.rb', line 4 def initialize(hash) @name = hash[:name] || hash['name'] || '' @path = hash[:path] || hash['path'] || '' @method = hash[:method] || hash['method'] || '' @headers = hash[:headers] || hash['headers'] || {} @variables = hash[:vars] || hash['vars'] || {} @data = hash[:data] || hash['data'] || nil end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
2 3 4 |
# File 'lib/request.rb', line 2 def data @data end |
#headers ⇒ Object
Returns the value of attribute headers.
2 3 4 |
# File 'lib/request.rb', line 2 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method.
2 3 4 |
# File 'lib/request.rb', line 2 def method @method end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/request.rb', line 2 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
2 3 4 |
# File 'lib/request.rb', line 2 def path @path end |
#variables ⇒ Object
Returns the value of attribute variables.
2 3 4 |
# File 'lib/request.rb', line 2 def variables @variables end |