class GorgService::ReplyMessage
Attributes
error_name[RW]
@return [String] Name identifying the error
error_type[RW]
@return [String] Error type ('hardfail','softfail')
next_try_in[RW]
@return [Integer] Time until next attempts in milliseconds
status_code[RW]
@return [String] Error code, HTTP like
Public Class Methods
new(opts={})
click to toggle source
@param opts [Hash] Attributes of the message @option opts [String] :status_code See {#status_code}. Default : nil @option opts [String] :error_type See {#error_type}. Default : nil @option opts [Integer] :next_try_in See {#next_try_in}. Default : nil @option opts [String] :error_name See {#error_name}. Default : nil @see GorgService::Message#initialize
Calls superclass method
GorgService::Message::new
# File lib/gorg_service/reply_message.rb, line 26 def initialize(opts={}) super self.status_code= opts.fetch(:status_code,nil) self.error_type= opts.fetch(:error_type,nil) self.next_try_in= opts.fetch(:next_try_in,nil) self.error_name= opts.fetch(:error_name,nil) end
Public Instance Methods
type()
click to toggle source
# File lib/gorg_service/reply_message.rb, line 16 def type "reply" end
validate()
click to toggle source
Calls superclass method
GorgService::Message#validate
# File lib/gorg_service/reply_message.rb, line 34 def validate self.validation_errors[:status_code]+=["is null"] unless self.status_code self.validation_errors[:error_type]+=["is not in (softfail hardfail)"] unless self.error_type && (%w(softfail hardfail).include? self.error_type) super end