class MultipleMan::Identity::MultipleField

Attributes

identify_by[RW]

Public Class Methods

new(record, identify_by) click to toggle source
Calls superclass method MultipleMan::Identity::new
# File lib/multiple_man/identity.rb, line 18
def initialize(record, identify_by)
  self.identify_by = identify_by ? [*identify_by] : [:id]
  super(record)
end

Public Instance Methods

value() click to toggle source
# File lib/multiple_man/identity.rb, line 22
def value
  Hash[identify_by.map do |field|
    [field, record.send(field)]
  end]
end