Class: Krakow::FrameType::Message
- Inherits:
-
Krakow::FrameType
- Object
- Krakow::FrameType
- Krakow::FrameType::Message
- Defined in:
- lib/krakow/frame_type/message.rb
Overview
Message received from server
Constant Summary
Constants inherited from Krakow::FrameType
Instance Attribute Summary collapse
- #connection ⇒ Krakow::Connection
-
#instance_stamp ⇒ Float
readonly
Time of message instance creation.
- #origin ⇒ Krakow::Consumer
Attributes included from Utils::Lazy::InstanceMethods
Attributes collapse
-
#attempts ⇒ Integer
The attempts attribute.
-
#attempts? ⇒ TrueClass, FalseClass
Truthiness of the attempts attribute.
-
#message ⇒ String
The message attribute.
-
#message? ⇒ TrueClass, FalseClass
Truthiness of the message attribute.
-
#message_id ⇒ String
The message_id attribute.
-
#message_id? ⇒ TrueClass, FalseClass
Truthiness of the message_id attribute.
-
#timestamp ⇒ Integer
The timestamp attribute.
-
#timestamp? ⇒ TrueClass, FalseClass
Truthiness of the timestamp attribute.
Instance Method Summary collapse
-
#confirm(*args) ⇒ Object
(also: #finish)
Proxy to [Krakow::Consumer#confirm].
-
#content ⇒ String
Message content.
-
#initialize(*args) ⇒ Message
constructor
A new instance of Message.
-
#requeue(*args) ⇒ Object
Proxy to [Krakow::Consumer#requeue].
-
#touch(*args) ⇒ Object
Proxy to [Krakow::Consumer#touch].
Methods inherited from Krakow::FrameType
Methods included from Utils::Lazy::ClassMethods
#attribute, #attributes, #set_attributes
Methods included from Utils::Lazy::InstanceMethods
Methods included from Utils::Lazy
Methods included from Utils::Logging
Constructor Details
#initialize(*args) ⇒ Message
Returns a new instance of Message.
26 27 28 29 |
# File 'lib/krakow/frame_type/message.rb', line 26 def initialize(*args) super @instance_stamp = Time.now.to_f end |
Instance Attribute Details
#connection ⇒ Krakow::Connection
48 49 50 |
# File 'lib/krakow/frame_type/message.rb', line 48 def connection @connection end |
#instance_stamp ⇒ Float (readonly)
Returns time of message instance creation.
9 10 11 |
# File 'lib/krakow/frame_type/message.rb', line 9 def instance_stamp @instance_stamp end |
#origin ⇒ Krakow::Consumer
39 40 41 |
# File 'lib/krakow/frame_type/message.rb', line 39 def origin @origin end |
Instance Method Details
#attempts ⇒ Integer
Returns the attempts attribute.
19 |
# File 'lib/krakow/frame_type/message.rb', line 19 attribute :attempts, Integer, :required => true |
#attempts? ⇒ TrueClass, FalseClass
Returns truthiness of the attempts attribute.
19 |
# File 'lib/krakow/frame_type/message.rb', line 19 attribute :attempts, Integer, :required => true |
#confirm(*args) ⇒ Object Also known as: finish
Proxy to [Krakow::Consumer#confirm]
57 58 59 |
# File 'lib/krakow/frame_type/message.rb', line 57 def confirm(*args) origin.confirm(*[self, *args].compact) end |
#content ⇒ String
Message content
34 35 36 |
# File 'lib/krakow/frame_type/message.rb', line 34 def content end |
#message ⇒ String
Returns the message attribute.
22 |
# File 'lib/krakow/frame_type/message.rb', line 22 attribute :message, String, :required => true |
#message? ⇒ TrueClass, FalseClass
Returns truthiness of the message attribute.
22 |
# File 'lib/krakow/frame_type/message.rb', line 22 attribute :message, String, :required => true |
#message_id ⇒ String
Returns the message_id attribute.
21 |
# File 'lib/krakow/frame_type/message.rb', line 21 attribute :message_id, String, :required => true |
#message_id? ⇒ TrueClass, FalseClass
Returns truthiness of the message_id attribute.
21 |
# File 'lib/krakow/frame_type/message.rb', line 21 attribute :message_id, String, :required => true |
#requeue(*args) ⇒ Object
Proxy to [Krakow::Consumer#requeue]
63 64 65 |
# File 'lib/krakow/frame_type/message.rb', line 63 def requeue(*args) origin.requeue(*[self, *args].compact) end |
#timestamp ⇒ Integer
Returns the timestamp attribute.
20 |
# File 'lib/krakow/frame_type/message.rb', line 20 attribute :timestamp, Integer, :required => true |
#timestamp? ⇒ TrueClass, FalseClass
Returns truthiness of the timestamp attribute.
20 |
# File 'lib/krakow/frame_type/message.rb', line 20 attribute :timestamp, Integer, :required => true |
#touch(*args) ⇒ Object
Proxy to [Krakow::Consumer#touch]
68 69 70 |
# File 'lib/krakow/frame_type/message.rb', line 68 def touch(*args) origin.touch(*[self, *args].compact) end |