class StandupMD::Post::Result
Result returned by posting adapters.
Attributes
The adapter that handled the post.
@return [Symbol]
The destination channel, room, or conversation identifier.
@return [String, nil]
Human-readable error message for failed posts.
@return [String, nil]
Adapter-specific response metadata.
@return [Hash]
Public Class Methods
Source
# File lib/standup_md/post/result.rb, line 60 def self.failure(adapter:, channel:, error:, response: {}) new( success: false, adapter: adapter, channel: channel, response: response, error: error ) end
Builds a failed result.
@return [StandupMD::Post::Result]
Source
# File lib/standup_md/post/result.rb, line 40 def initialize(success:, adapter:, channel:, response: {}, error: nil) @success = success @adapter = adapter.to_sym @channel = channel @response = response @error = error end
Builds a posting result.
@param success [Boolean] @param adapter [String, Symbol] @param channel [String, nil] @param response [Hash] @param error [String, nil]
Source
# File lib/standup_md/post/result.rb, line 52 def self.success(adapter:, channel:, response: {}) new(success: true, adapter: adapter, channel: channel, response: response) end
Builds a successful result.
@return [StandupMD::Post::Result]
Public Instance Methods
Source
# File lib/standup_md/post/result.rb, line 82 def failure? !success? end
Did the post fail?
@return [Boolean]
Source
# File lib/standup_md/post/result.rb, line 74 def success? @success end
Was the post successful?
@return [Boolean]