Class: PgqEvent
- Inherits:
-
Object
- Object
- PgqEvent
- Defined in:
- lib/pgq_event.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#extra1 ⇒ Object
Returns the value of attribute extra1.
-
#extra2 ⇒ Object
Returns the value of attribute extra2.
-
#extra3 ⇒ Object
Returns the value of attribute extra3.
-
#extra4 ⇒ Object
Returns the value of attribute extra4.
-
#id ⇒ Object
Returns the value of attribute id.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(pgq_tuple = nil, use_yaml = true) ⇒ PgqEvent
constructor
A new instance of PgqEvent.
Constructor Details
#initialize(pgq_tuple = nil, use_yaml = true) ⇒ PgqEvent
Returns a new instance of PgqEvent.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pgq_event.rb', line 4 def initialize pgq_tuple = nil, use_yaml = true if pgq_tuple.is_a? Hash @id = pgq_tuple['ev_id'] @type = pgq_tuple['ev_type'] if use_yaml @data = YAML.load pgq_tuple['ev_data'] @extra1 = YAML.load pgq_tuple['extra1'] if pgq_tuple['extra1'] @extra2 = YAML.load pgq_tuple['extra2'] if pgq_tuple['extra2'] @extra3 = YAML.load pgq_tuple['extra3'] if pgq_tuple['extra3'] @extra4 = YAML.load pgq_tuple['extra4'] if pgq_tuple['extra4'] else @data = pgq_tuple['ev_data'] @extra1 = pgq_tuple['extra1'] @extra2 = pgq_tuple['extra2'] @extra3 = pgq_tuple['extra3'] @extra4 = pgq_tuple['extra4'] end end end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
2 3 4 |
# File 'lib/pgq_event.rb', line 2 def data @data end |
#extra1 ⇒ Object
Returns the value of attribute extra1.
2 3 4 |
# File 'lib/pgq_event.rb', line 2 def extra1 @extra1 end |
#extra2 ⇒ Object
Returns the value of attribute extra2.
2 3 4 |
# File 'lib/pgq_event.rb', line 2 def extra2 @extra2 end |
#extra3 ⇒ Object
Returns the value of attribute extra3.
2 3 4 |
# File 'lib/pgq_event.rb', line 2 def extra3 @extra3 end |
#extra4 ⇒ Object
Returns the value of attribute extra4.
2 3 4 |
# File 'lib/pgq_event.rb', line 2 def extra4 @extra4 end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/pgq_event.rb', line 2 def id @id end |
#type ⇒ Object
Returns the value of attribute type.
2 3 4 |
# File 'lib/pgq_event.rb', line 2 def type @type end |