Class: Kampainer::ContactKeys

Inherits:
SchemaCollection show all
Defined in:
lib/kampainer/contact.rb

Direct Known Subclasses

ArrayOfContactKey

Instance Method Summary collapse

Methods inherited from SchemaObject

#inspect

Constructor Details

#initialize(keys = []) ⇒ ContactKeys

Returns a new instance of ContactKeys.



52
53
54
55
56
57
58
59
60
61
# File 'lib/kampainer/contact.rb', line 52

def initialize(keys = [])
  @collection = keys.map do |key|
    case key
    when Contact::Key then key
    when Integer then Contact::Key.new(id: key)
    when String then Contact::Key.new(unique_identifier: key)
    else Contact::Key.new(key)
    end
  end
end