Sha256: e03dc7dd3d3258ee9c50b4d9eba8d39995852ca4959478126f1296805760ca12
Contents?: true
Size: 1.26 KB
Versions: 2
Compression:
Stored size: 1.26 KB
Contents
require "securerandom" module Bright class Contact < Model @attribute_names = [:client_id, :api_id, :first_name, :middle_name, :last_name, :nick_name, :birth_date, :sex, :relationship_type, :hispanic_ethnicity, :race, :image, :sis_student_id, :state_student_id, :last_modified] attr_accessor(*@attribute_names) def self.attribute_names @attribute_names end attr_accessor :phone_numbers, :addresses, :email_address def phone_numbers=(array) if array.size <= 0 or array.first.is_a?(PhoneNumber) @phone_numbers = array elsif array.first.is_a?(Hash) @phone_numbers = array.collect { |a| PhoneNumber.new(a) } end @phone_numbers ||= [] end def phone_numbers @phone_numbers ||= [] end def addresses=(array) if array.size <= 0 or array.first.is_a?(Address) @addresses = array elsif array.first.is_a?(Hash) @addresses = array.collect { |a| Address.new(a) } end @addresses ||= [] end def addresses @addresses ||= [] end def email_address=(email) if email.is_a?(EmailAddress) @email_address = email elsif email.is_a?(Hash) @email_address = EmailAddress.new(email) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bright-2.1 | lib/bright/contact.rb |
bright-2.0 | lib/bright/contact.rb |