Class: Google::Cloud::Pubsub::PublishResult

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/pubsub/publish_result.rb

Overview

PublishResult

Instance Method Summary collapse

Instance Method Details

#attributesObject

The message's attributes.



45
46
47
# File 'lib/google/cloud/pubsub/publish_result.rb', line 45

def attributes
  message.attributes
end

#dataObject

The message's data.



39
40
41
# File 'lib/google/cloud/pubsub/publish_result.rb', line 39

def data
  message.data
end

#errorObject

The error that was raised when published, if any.



66
67
68
# File 'lib/google/cloud/pubsub/publish_result.rb', line 66

def error
  @error
end

#failed?Boolean

Whether the publish request failed.

Returns:

  • (Boolean)


77
78
79
# File 'lib/google/cloud/pubsub/publish_result.rb', line 77

def failed?
  !succeeded?
end

#messageObject Also known as: msg

The message.



32
33
34
# File 'lib/google/cloud/pubsub/publish_result.rb', line 32

def message
  @message
end

#message_idObject Also known as: msg_id

The ID of the message, assigned by the server at publication time. Guaranteed to be unique within the topic.



52
53
54
# File 'lib/google/cloud/pubsub/publish_result.rb', line 52

def message_id
  message.message_id
end

#published_atObject Also known as: publish_time

The time at which the message was published.



59
60
61
# File 'lib/google/cloud/pubsub/publish_result.rb', line 59

def published_at
  message.published_at
end

#succeeded?Boolean

Whether the publish request was successful.

Returns:

  • (Boolean)


72
73
74
# File 'lib/google/cloud/pubsub/publish_result.rb', line 72

def succeeded?
  error.nil?
end