Class: Bidi2pdf::Bidi::EventManager::Listener

Inherits:
Struct
  • Object
show all
Defined in:
lib/bidi2pdf/bidi/event_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



6
7
8
# File 'lib/bidi2pdf/bidi/event_manager.rb', line 6

def block
  @block
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



6
7
8
# File 'lib/bidi2pdf/bidi/event_manager.rb', line 6

def id
  @id
end

#source_locationObject

Returns the value of attribute source_location

Returns:

  • (Object)

    the current value of 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

#hashObject



22
23
24
# File 'lib/bidi2pdf/bidi/event_manager.rb', line 22

def hash
  id.hash
end