Class: SimpleVpim
- Inherits:
-
Object
- Object
- SimpleVpim
- Defined in:
- lib/simplevpim.rb
Instance Attribute Summary collapse
-
#to_vcard ⇒ Object
(also: #to_vcf)
readonly
Returns the value of attribute to_vcard.
-
#to_vevent ⇒ Object
readonly
Returns the value of attribute to_vevent.
-
#to_xml ⇒ Object
readonly
Returns the value of attribute to_xml.
Instance Method Summary collapse
-
#initialize(s) ⇒ SimpleVpim
constructor
A new instance of SimpleVpim.
- #to_hcard(layout = nil) ⇒ Object
- #to_xcard ⇒ Object
Constructor Details
#initialize(s) ⇒ SimpleVpim
Returns a new instance of SimpleVpim.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/simplevpim.rb', line 17 def initialize(s) kvx = Kvx.new(s) @h = kvx.to_h if s.lstrip =~ /# vcard/ and @h[:name] then @to_vcard = make_vcard @h @to_xml = vcard_xml @h elsif @h[:title] or @h[:summary] @to_vevent = make_vevent @h @to_xml = vevent_xml kvx.to_xml end end |
Instance Attribute Details
#to_vcard ⇒ Object (readonly) Also known as: to_vcf
Returns the value of attribute to_vcard.
15 16 17 |
# File 'lib/simplevpim.rb', line 15 def to_vcard @to_vcard end |
#to_vevent ⇒ Object (readonly)
Returns the value of attribute to_vevent.
15 16 17 |
# File 'lib/simplevpim.rb', line 15 def to_vevent @to_vevent end |
#to_xml ⇒ Object (readonly)
Returns the value of attribute to_xml.
15 16 17 |
# File 'lib/simplevpim.rb', line 15 def to_xml @to_xml end |
Instance Method Details
#to_hcard(layout = nil) ⇒ Object
38 39 40 |
# File 'lib/simplevpim.rb', line 38 def to_hcard(layout=nil) make_hcard layout, @h end |
#to_xcard ⇒ Object
42 43 44 |
# File 'lib/simplevpim.rb', line 42 def to_xcard() make_xcard @to_xml end |