Parent

Namespace

Methods

Included Modules

Files

Virtus::Equalizer

Define equality, equivalence and inspection methods

Public Class Methods

new(name, keys = []) click to toggle source

Initialize an Equalizer with the given keys

Will use the keys with which it is initialized to define cmp?, hash, and inspect

@param [String] name

@param [Array<Symbol>] keys

@return [undefined]

@api private

# File lib/virtus/support/equalizer.rb, line 18
def initialize(name, keys = [])
  @name = name.dup.freeze
  @keys = keys.dup
  define_methods
  include_comparison_methods
end

Public Instance Methods

<<(key) click to toggle source

Append a key and compile the equality methods

@return [Equalizer] self

@api private

# File lib/virtus/support/equalizer.rb, line 30
def <<(key)
  @keys << key
  self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.