Class: Bidi2pdf::Bidi::EventManager::Listener
- Inherits:
-
Struct
- Object
- Struct
- Bidi2pdf::Bidi::EventManager::Listener
- Defined in:
- lib/bidi2pdf/bidi/event_manager.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#id ⇒ Object
Returns the value of attribute id.
-
#source_location ⇒ Object
Returns the value of attribute source_location.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #call(*args) ⇒ Object
- #hash ⇒ Object
-
#initialize(block, id = SecureRandom.uuid) ⇒ Listener
constructor
A new instance of Listener.
Constructor Details
#initialize(block, id = SecureRandom.uuid) ⇒ Listener
Returns a new instance of Listener.
7 8 9 10 |
# File 'lib/bidi2pdf/bidi/event_manager.rb', line 7 def initialize(block, id = SecureRandom.uuid) super self.source_location = block.source_location end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
6 7 8 |
# File 'lib/bidi2pdf/bidi/event_manager.rb', line 6 def block @block end |
#id ⇒ Object
Returns the value of attribute id
6 7 8 |
# File 'lib/bidi2pdf/bidi/event_manager.rb', line 6 def id @id end |
#source_location ⇒ Object
Returns the value of attribute source_location
6 7 8 |
# File 'lib/bidi2pdf/bidi/event_manager.rb', line 6 def source_location @source_location end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
16 17 18 |
# File 'lib/bidi2pdf/bidi/event_manager.rb', line 16 def ==(other) other.is_a?(Listener) && id == other.id end |
#call(*args) ⇒ Object
12 13 14 |
# File 'lib/bidi2pdf/bidi/event_manager.rb', line 12 def call(*args) block.call(*args) end |
#hash ⇒ Object
22 23 24 |
# File 'lib/bidi2pdf/bidi/event_manager.rb', line 22 def hash id.hash end |