Class: Rack::Insight::DefaultInvocation
- Inherits:
-
Struct
- Object
- Struct
- Rack::Insight::DefaultInvocation
- Includes:
- FilteredBacktrace, MagicInsight
- Defined in:
- lib/rack/insight/default_invocation.rb
Constant Summary
Constants included from MagicInsight
MagicInsight::ANCESTORS_FILTER, MagicInsight::IDIOMS, MagicInsight::SAFETY_REGEX_FILTER, MagicInsight::WARNING
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#backtrace ⇒ Object
Returns the value of attribute backtrace.
-
#method ⇒ Object
Returns the value of attribute method.
-
#result ⇒ Object
Returns the value of attribute result.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
- #human_time ⇒ Object
-
#initialize(*args) ⇒ DefaultInvocation
constructor
A new instance of DefaultInvocation.
Methods included from MagicInsight
#_dirty_ancestors, #_dirty_methods, #_filtered_ancestors, #_filtered_methods, #_has_idioms?, #_idiomatic_method, #_idiomatic_methods, #_magic_insight_methods, #_my_children, #_sorted_methods, included
Methods included from FilteredBacktrace
backtrace_regexp, #filtered_backtrace, #has_backtrace?, root_for_backtrace_filtering
Constructor Details
#initialize(*args) ⇒ DefaultInvocation
Returns a new instance of DefaultInvocation.
9 10 11 12 13 14 15 |
# File 'lib/rack/insight/default_invocation.rb', line 9 def initialize(*args) @method = args[0] @time = [args[1].duration, args[1].delta_t] @arguments = args[2] @result = args[3] @backtrace = args[4] end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments
3 4 5 |
# File 'lib/rack/insight/default_invocation.rb', line 3 def arguments @arguments end |
#backtrace ⇒ Object
Returns the value of attribute backtrace
3 4 5 |
# File 'lib/rack/insight/default_invocation.rb', line 3 def backtrace @backtrace end |
#method ⇒ Object
Returns the value of attribute method
3 4 5 |
# File 'lib/rack/insight/default_invocation.rb', line 3 def method @method end |
#result ⇒ Object
Returns the value of attribute result
3 4 5 |
# File 'lib/rack/insight/default_invocation.rb', line 3 def result @result end |
#time ⇒ Object
Returns the value of attribute time
3 4 5 |
# File 'lib/rack/insight/default_invocation.rb', line 3 def time @time end |
Instance Method Details
#human_time ⇒ Object
17 18 19 |
# File 'lib/rack/insight/default_invocation.rb', line 17 def human_time "%.2fms" % (self.time * 1_000) end |