Class: Upay::People::Person

Inherits:
Object
  • Object
show all
Defined in:
lib/upay/people/person.rb

Direct Known Subclasses

Buyer, Payer

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Person

Returns a new instance of Person.



4
5
6
7
8
# File 'lib/upay/people/person.rb', line 4

def initialize(args = {})
  args.each do |k,v|
    instance_variable_set("@#{k}", v)
  end
end

Instance Method Details

#contactPhoneObject



16
# File 'lib/upay/people/person.rb', line 16

def contactPhone; @contactPhone end

#contactPhone=(contactPhone) ⇒ Object



17
# File 'lib/upay/people/person.rb', line 17

def contactPhone=(contactPhone) @contactPhone = contactPhone; end

#emailAddressObject



13
# File 'lib/upay/people/person.rb', line 13

def emailAddress; @emailAddress end

#emailAddress=(emailAddress) ⇒ Object



14
# File 'lib/upay/people/person.rb', line 14

def emailAddress=(emailAddress) @emailAddress = emailAddress end

#fullNameObject



10
# File 'lib/upay/people/person.rb', line 10

def fullName; @fullName end

#fullName=(fullName) ⇒ Object



11
# File 'lib/upay/people/person.rb', line 11

def fullName=(fullName) @fullName = fullName end

#to_hashObject



24
25
26
# File 'lib/upay/people/person.rb', line 24

def to_hash
  person_hash = self.instance_variables.each_with_object({}) { |var,hash| hash[var.to_s.delete("@").to_sym] = self.instance_variable_get(var)}
end

#valid?Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/upay/people/person.rb', line 19

def valid?
  validator = PersonValidator.new
  validator.valid?(self)
end