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.
20 21 22 23 |
# File 'lib/fluent/plugin/gcloud_pubsub/client.rb', line 20 def initialize(, attributes = {}) = @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
18 19 20 |
# File 'lib/fluent/plugin/gcloud_pubsub/client.rb', line 18 def attributes @attributes end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
18 19 20 |
# File 'lib/fluent/plugin/gcloud_pubsub/client.rb', line 18 def end |
Instance Method Details
#bytesize ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/fluent/plugin/gcloud_pubsub/client.rb', line 25 def bytesize attr_size = 0 @attributes.each do |key, val| attr_size += key.bytesize + val.bytesize end .bytesize + attr_size end |