Class: MultipleMan::Identity
- Inherits:
-
Object
- Object
- MultipleMan::Identity
- Defined in:
- lib/multiple_man/identity.rb
Direct Known Subclasses
Defined Under Namespace
Classes: MultipleField, SingleField
Instance Attribute Summary collapse
-
#record ⇒ Object
Returns the value of attribute record.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(record) ⇒ Identity
constructor
A new instance of Identity.
Constructor Details
#initialize(record) ⇒ Identity
Returns a new instance of Identity.
11 12 13 |
# File 'lib/multiple_man/identity.rb', line 11 def initialize(record) self.record = record end |
Instance Attribute Details
#record ⇒ Object
Returns the value of attribute record.
15 16 17 |
# File 'lib/multiple_man/identity.rb', line 15 def record @record end |
Class Method Details
.build(record, options) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/multiple_man/identity.rb', line 3 def self.build(record, ) if [:identifier].present? SingleField.new(record, [:identifier]) else MultipleField.new(record, [:identify_by]) end end |