Class: Person
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Person
- Defined in:
- app/models/person.rb
Constant Summary collapse
- MALE =
sex enumeration
1
- FEMALE =
2
Instance Method Summary collapse
-
#initialize(attributes = nil, options = {}) ⇒ Person
constructor
Constructor.
-
#to_s(format = :default) ⇒ Object
String.
Constructor Details
#initialize(attributes = nil, options = {}) ⇒ Person
Constructor
38 39 40 41 42 43 |
# File 'app/models/person.rb', line 38 def initialize(attributes = nil, = {}) super build_vcard unless vcard vcard.build_address unless vcard.address end |
Instance Method Details
#to_s(format = :default) ⇒ Object
String
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/models/person.rb', line 11 def to_s(format = :default) return unless vcard s = vcard.full_name case format when :long s += " (#{vcard.locality})" if vcard.locality end return s end |