Class: Blackbook::Exporter::Vcf::Vcard
- Inherits:
-
Object
- Object
- Blackbook::Exporter::Vcf::Vcard
- Defined in:
- lib/blackbook/exporter/vcf.rb
Overview
representation of a vcard
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#first ⇒ Object
Returns the value of attribute first.
-
#last ⇒ Object
Returns the value of attribute last.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Vcard
constructor
initialize dynamically sets the attributes passed in as accessible attribute on its object.
-
#to_s ⇒ Object
text representation of this vcard.
Constructor Details
#initialize(attributes = {}) ⇒ Vcard
initialize dynamically sets the attributes passed in as accessible attribute on its object
16 17 18 |
# File 'lib/blackbook/exporter/vcf.rb', line 16 def initialize( attributes = {} ) attributes.each{ |name,value| self.send("#{name}=", value) rescue next } end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/blackbook/exporter/vcf.rb', line 10 def email @email end |
#first ⇒ Object
Returns the value of attribute first.
10 11 12 |
# File 'lib/blackbook/exporter/vcf.rb', line 10 def first @first end |
#last ⇒ Object
Returns the value of attribute last.
10 11 12 |
# File 'lib/blackbook/exporter/vcf.rb', line 10 def last @last end |
Instance Method Details
#to_s ⇒ Object
text representation of this vcard
22 23 24 25 26 27 28 29 |
# File 'lib/blackbook/exporter/vcf.rb', line 22 def to_s <<-EOVC BEGIN:VCARD N:#{last};#{first} EMAIL:#{email} END:VCARD EOVC end |