Class: Ccp::Receivers::Profileable::Profile
- Inherits:
-
Struct
- Object
- Struct
- Ccp::Receivers::Profileable::Profile
- Defined in:
- lib/ccp/receivers/profileable.rb,
lib/ccp/receivers/profileable.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
Returns the value of attribute method.
-
#target ⇒ Object
Returns the value of attribute target.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
Instance Attribute Details
#method ⇒ Object
Returns the value of attribute method
6 7 8 |
# File 'lib/ccp/receivers/profileable.rb', line 6 def method @method end |
#target ⇒ Object
Returns the value of attribute target
6 7 8 |
# File 'lib/ccp/receivers/profileable.rb', line 6 def target @target end |
#time ⇒ Object
Returns the value of attribute time
6 7 8 |
# File 'lib/ccp/receivers/profileable.rb', line 6 def time @time end |
Instance Method Details
#name ⇒ Object
8 9 10 |
# File 'lib/ccp/receivers/profileable.rb', line 8 def name target.is_a?(Class) ? "#{target.name}.#{method}" : "#{target.class}##{method}" end |
#profile(total) ⇒ Object
12 13 14 |
# File 'lib/ccp/receivers/profileable.rb', line 12 def profile(total) "[%4.1f%%] %.7f %s" % [(time*100/total), time, name] end |