module MR::ReadModelStruct::InstanceMethods

Public Class Methods

new(data = nil) click to toggle source
# File lib/mr/read_model.rb, line 59
def initialize(data = nil)
  set_read_model_data(data || {})
end

Public Instance Methods

==(other) click to toggle source
Calls superclass method
# File lib/mr/read_model.rb, line 63
def ==(other)
  if other.kind_of?(self.class)
    self.fields == other.fields
  else
    super
  end
end
inspect() click to toggle source
# File lib/mr/read_model.rb, line 71
def inspect
  object_hex     = (self.object_id << 1).to_s(16)
  fields_inspect = self.class.fields.map do |field|
    "#{field.ivar_name}=#{field.read(self.read_model_data).inspect}"
  end.sort.join(" ")
  "#<#{self.class}:0x#{object_hex} #{fields_inspect}>"
end