Class: Fluent::GcloudPubSub::Message
- Inherits:
-
Object
- Object
- Fluent::GcloudPubSub::Message
- Defined in:
- lib/fluent/plugin/gcloud_pubsub/client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #bytesize ⇒ Object
-
#initialize(message, attributes = {}) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(message, attributes = {}) ⇒ Message
Returns a new instance of Message.
12 13 14 15 |
# File 'lib/fluent/plugin/gcloud_pubsub/client.rb', line 12 def initialize(, attributes={}) @message = @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
11 12 13 |
# File 'lib/fluent/plugin/gcloud_pubsub/client.rb', line 11 def attributes @attributes end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
11 12 13 |
# File 'lib/fluent/plugin/gcloud_pubsub/client.rb', line 11 def @message end |
Instance Method Details
#bytesize ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/fluent/plugin/gcloud_pubsub/client.rb', line 17 def bytesize() attr_size = 0 @attributes.each do |key, val| attr_size += key.bytesize + val.bytesize end @message.bytesize + attr_size end |