Class: Flash::Integration::Request
- Inherits:
-
Object
- Object
- Flash::Integration::Request
- Defined in:
- lib/flash/integration/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(attributes) ⇒ Request
Returns a new instance of Request.
8 9 10 11 12 13 14 15 |
# File 'lib/flash/integration/request.rb', line 8 def initialize(attributes) @method = attributes.fetch(:method) @url = attributes.fetch(:url) @params = attributes[:params] || {} @headers = attributes[:headers] || {} @body = attributes[:body] || {} @time = attributes[:time] || Time.now.utc end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/flash/integration/request.rb', line 6 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
6 7 8 |
# File 'lib/flash/integration/request.rb', line 6 def headers @headers end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
6 7 8 |
# File 'lib/flash/integration/request.rb', line 6 def method @method end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/flash/integration/request.rb', line 6 def params @params end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
6 7 8 |
# File 'lib/flash/integration/request.rb', line 6 def time @time end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/flash/integration/request.rb', line 6 def url @url end |