class DispatchRider::Message

Attributes

body[RW]
subject[RW]

Public Class Methods

new(options) click to toggle source
# File lib/dispatch-rider/message.rb, line 15
def initialize(options)
  attrs = options.symbolize_keys
  @subject = attrs[:subject]
  @body = attrs[:body] || {}
  raise RecordInvalid.new(self, errors.full_messages) unless valid?
end

Public Instance Methods

==(other) click to toggle source
# File lib/dispatch-rider/message.rb, line 30
def ==(other)
  return false unless other.respond_to? :attributes

  attributes == other.attributes
end
as_json(*) click to toggle source
# File lib/dispatch-rider/message.rb, line 26
def as_json(*)
  attributes
end
attributes() click to toggle source
# File lib/dispatch-rider/message.rb, line 22
def attributes
  { subject: subject, body: body }
end