Class: SmswayApi::Message::Vcard
- Inherits:
-
SmswayApi::Message
- Object
- SmswayApi::Message
- SmswayApi::Message::Vcard
- Defined in:
- lib/smsway_api/message/vcard.rb
Constant Summary
Constants inherited from SmswayApi::Message
Instance Attribute Summary
Attributes inherited from SmswayApi::Message
Instance Method Summary collapse
- #build(xml, start_index = 0) ⇒ Object
-
#initialize(vcard = {}) ⇒ Vcard
constructor
allowed options: url name phone cell work fax email position organization address post_office_box street city region postal_code country additional.
Methods inherited from SmswayApi::Message
Constructor Details
#initialize(vcard = {}) ⇒ Vcard
allowed options:
url
name
phone
cell
work
fax
email
position
organization
address
post_office_box
street
city
region
postal_code
country
additional
21 22 23 24 |
# File 'lib/smsway_api/message/vcard.rb', line 21 def initialize(vcard = {}) super(:vcard) @vcard = vcard end |
Instance Method Details
#build(xml, start_index = 0) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/smsway_api/message/vcard.rb', line 26 def build(xml, start_index = 0) super do |xml| [:url, :name, :email, :position, :organization, :additional, :phone, :address].each do |key| if @vcard.has_key?(key) xml.tag!(key, @vcard[key]) end end end end |