Class: Stumb::Stamp
- Inherits:
-
Object
- Object
- Stumb::Stamp
- Defined in:
- lib/stumb/stamp.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(req) ⇒ Stamp
constructor
A new instance of Stamp.
Constructor Details
#initialize(req) ⇒ Stamp
Returns a new instance of Stamp.
4 5 6 7 |
# File 'lib/stumb/stamp.rb', line 4 def initialize(req) @time = Time.now @request = req end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
3 4 5 |
# File 'lib/stumb/stamp.rb', line 3 def request @request end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
3 4 5 |
# File 'lib/stumb/stamp.rb', line 3 def time @time end |
Instance Method Details
#body ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/stumb/stamp.rb', line 9 def body return @body if @body begin @body ||= @request.body.read ensure @request.body.rewind end end |