Class: Upay::People::Person
- Inherits:
-
Object
- Object
- Upay::People::Person
- Defined in:
- lib/upay/people/person.rb
Instance Method Summary collapse
- #contactPhone ⇒ Object
- #contactPhone=(contactPhone) ⇒ Object
- #emailAddress ⇒ Object
- #emailAddress=(emailAddress) ⇒ Object
- #fullName ⇒ Object
- #fullName=(fullName) ⇒ Object
-
#initialize(args = {}) ⇒ Person
constructor
A new instance of Person.
- #to_hash ⇒ Object
- #valid? ⇒ Boolean
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
#contactPhone ⇒ Object
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 |
#emailAddress ⇒ Object
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 |
#fullName ⇒ Object
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_hash ⇒ Object
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
19 20 21 22 |
# File 'lib/upay/people/person.rb', line 19 def valid? validator = PersonValidator.new validator.valid?(self) end |