Class: Lens::Event
- Inherits:
-
Object
- Object
- Lens::Event
- Defined in:
- lib/lens/event.rb
Instance Attribute Summary collapse
-
#end ⇒ Object
readonly
Returns the value of attribute end.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
Instance Method Summary collapse
- #duration ⇒ Object
-
#initialize(options = {}) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(options = {}) ⇒ Event
Returns a new instance of Event.
5 6 7 8 9 10 11 12 13 |
# File 'lib/lens/event.rb', line 5 def initialize( = {}) raise ArgumentError unless all_params_present?() @name = [:name] @time = [:started] @end = [:finished] @transaction_id = [:transaction_id] @payload = [:payload] end |
Instance Attribute Details
#end ⇒ Object (readonly)
Returns the value of attribute end.
3 4 5 |
# File 'lib/lens/event.rb', line 3 def end @end end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/lens/event.rb', line 3 def name @name end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
3 4 5 |
# File 'lib/lens/event.rb', line 3 def payload @payload end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
3 4 5 |
# File 'lib/lens/event.rb', line 3 def time @time end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
3 4 5 |
# File 'lib/lens/event.rb', line 3 def transaction_id @transaction_id end |
Instance Method Details
#duration ⇒ Object
15 16 17 |
# File 'lib/lens/event.rb', line 15 def duration 1000.0 * (self.end - time) end |