Class: Wisper::Visualize::RecordingBroadcaster::Event
- Inherits:
-
Object
- Object
- Wisper::Visualize::RecordingBroadcaster::Event
- Defined in:
- lib/wisper/visualize/recording_broadcaster.rb
Instance Attribute Summary collapse
-
#arg_names ⇒ Object
readonly
Returns the value of attribute arg_names.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#frequency ⇒ Object
readonly
Returns the value of attribute frequency.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#publisher_name ⇒ Object
readonly
Returns the value of attribute publisher_name.
-
#subscriber_name ⇒ Object
readonly
Returns the value of attribute subscriber_name.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #frequency_label ⇒ Object
- #increment_frequency ⇒ Object
-
#initialize(subscriber, publisher, name, args) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(subscriber, publisher, name, args) ⇒ Event
Returns a new instance of Event.
40 41 42 43 44 45 46 47 |
# File 'lib/wisper/visualize/recording_broadcaster.rb', line 40 def initialize(subscriber, publisher, name, args) @subscriber_name = label(subscriber) @publisher_name = label(publisher) @name = name @arg_names = arg_labels(args) @frequency = 1 @created_at = Time.now end |
Instance Attribute Details
#arg_names ⇒ Object (readonly)
Returns the value of attribute arg_names.
37 38 39 |
# File 'lib/wisper/visualize/recording_broadcaster.rb', line 37 def arg_names @arg_names end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
37 38 39 |
# File 'lib/wisper/visualize/recording_broadcaster.rb', line 37 def created_at @created_at end |
#frequency ⇒ Object (readonly)
Returns the value of attribute frequency.
37 38 39 |
# File 'lib/wisper/visualize/recording_broadcaster.rb', line 37 def frequency @frequency end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
37 38 39 |
# File 'lib/wisper/visualize/recording_broadcaster.rb', line 37 def name @name end |
#publisher_name ⇒ Object (readonly)
Returns the value of attribute publisher_name.
37 38 39 |
# File 'lib/wisper/visualize/recording_broadcaster.rb', line 37 def publisher_name @publisher_name end |
#subscriber_name ⇒ Object (readonly)
Returns the value of attribute subscriber_name.
37 38 39 |
# File 'lib/wisper/visualize/recording_broadcaster.rb', line 37 def subscriber_name @subscriber_name end |
Instance Method Details
#==(other) ⇒ Object
57 58 59 60 61 62 |
# File 'lib/wisper/visualize/recording_broadcaster.rb', line 57 def ==(other) name == other.name && # arg_names == other.arg_names && subscriber_name == other.subscriber_name && publisher_name == other.publisher_name end |
#frequency_label ⇒ Object
49 50 51 |
# File 'lib/wisper/visualize/recording_broadcaster.rb', line 49 def frequency_label frequency == 1 ? '' : "#{frequency}x " end |
#increment_frequency ⇒ Object
53 54 55 |
# File 'lib/wisper/visualize/recording_broadcaster.rb', line 53 def increment_frequency @frequency += 1 end |