Class: Krakow::FrameType::Message

Inherits:
Krakow::FrameType show all
Defined in:
lib/krakow/frame_type/message.rb

Overview

Message received from server

Constant Summary

Constants inherited from Krakow::FrameType

FRAME_TYPE_MAP, SIZE_BYTES

Instance Attribute Summary collapse

Attributes included from Utils::Lazy::InstanceMethods

#arguments

Attributes collapse

Instance Method Summary collapse

Methods inherited from Krakow::FrameType

build, decode

Methods included from Utils::Lazy::ClassMethods

#attribute, #attributes, #set_attributes

Methods included from Utils::Lazy::InstanceMethods

#inspect, #to_s

Methods included from Utils::Lazy

included

Methods included from Utils::Logging

level=, #log

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

#connectionKrakow::Connection

Returns:



48
49
50
# File 'lib/krakow/frame_type/message.rb', line 48

def connection
  @connection
end

#instance_stampFloat (readonly)

Returns time of message instance creation.

Returns:

  • (Float)

    time of message instance creation



9
10
11
# File 'lib/krakow/frame_type/message.rb', line 9

def instance_stamp
  @instance_stamp
end

#originKrakow::Consumer

Returns:



39
40
41
# File 'lib/krakow/frame_type/message.rb', line 39

def origin
  @origin
end

Instance Method Details

#attemptsInteger

Returns the attempts attribute.

Returns:

  • (Integer)

    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.

Returns:

  • (TrueClass, FalseClass)

    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

#contentString

Message content

Returns:

  • (String)


34
35
36
# File 'lib/krakow/frame_type/message.rb', line 34

def content
  message
end

#messageString

Returns the message attribute.

Returns:

  • (String)

    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.

Returns:

  • (TrueClass, FalseClass)

    truthiness of the message attribute



22
# File 'lib/krakow/frame_type/message.rb', line 22

attribute :message, String, :required => true

#message_idString

Returns the message_id attribute.

Returns:

  • (String)

    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.

Returns:

  • (TrueClass, FalseClass)

    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

#timestampInteger

Returns the timestamp attribute.

Returns:

  • (Integer)

    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.

Returns:

  • (TrueClass, FalseClass)

    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