Class: Qpid::Proton::Event::EventType
- Inherits:
-
Object
- Object
- Qpid::Proton::Event::EventType
- Defined in:
- lib/event/event_type.rb
Overview
Manages the association between an Event and the method which should process on the context object associated with an occurance of the event.
Each type is identified by a unique #type value.
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
The method to invoke on any potential handler.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(number, method) ⇒ EventType
constructor
A new instance of EventType.
- #to_s ⇒ Object
Constructor Details
#initialize(number, method) ⇒ EventType
Returns a new instance of EventType.
51 52 53 54 55 56 57 |
# File 'lib/event/event_type.rb', line 51 def initialize(number, method) @number = number @name = Cproton.pn_event_type_name(@number) @method = method @@types ||= {} @@types[number] = self end |
Instance Attribute Details
#method ⇒ Object (readonly)
The method to invoke on any potential handler.
48 49 50 |
# File 'lib/event/event_type.rb', line 48 def method @method end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
49 50 51 |
# File 'lib/event/event_type.rb', line 49 def number @number end |
Class Method Details
.by_type(type) ⇒ Object
65 66 67 |
# File 'lib/event/event_type.rb', line 65 def self.by_type(type) # :nodoc: @@types[type] end |
Instance Method Details
#to_s ⇒ Object
60 61 62 |
# File 'lib/event/event_type.rb', line 60 def to_s @name end |