class OptionsModel::Base

Public Class Methods

derive(name = "AnonymousRecord") click to toggle source
# File lib/options_model/base.rb, line 41
def self.derive(name = "AnonymousRecord")
  Class.new(self) do
    include OptionsModel::Concerns::NameHacking
    self.name = name
  end
end
inspect() click to toggle source
# File lib/options_model/base.rb, line 33
def self.inspect
  "#<#{name}:OptionsModel [#{attribute_names.map(&:inspect).join(', ')}]>"
end

Public Instance Methods

==(other) click to toggle source
# File lib/options_model/base.rb, line 17
def ==(other)
  other.instance_of?(self.class) &&
    attributes == other.attributes &&
    nested_attributes == other.nested_attributes &&
    unused_attributes == other.unused_attributes
end
Also aliased as: eql?
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/options_model/base.rb, line 25
def hash
  [attributes, nested_attributes, unused_attributes].hash
end
inspect() click to toggle source
# File lib/options_model/base.rb, line 29
def inspect
  "#<#{self.class.name}:OptionsModel #{to_h}>"
end
persisted?() click to toggle source
# File lib/options_model/base.rb, line 37
def persisted?
  true
end