Class: XeroGateway::ContactPerson
- Inherits:
-
Object
- Object
- XeroGateway::ContactPerson
- Defined in:
- lib/xero_gateway/contact_person.rb
Instance Attribute Summary collapse
-
#email_address ⇒ Object
Returns the value of attribute email_address.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#include_in_emails ⇒ Object
Returns the value of attribute include_in_emails.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ ContactPerson
constructor
A new instance of ContactPerson.
- #to_xml(b = Builder::XmlMarkup.new) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ ContactPerson
Returns a new instance of ContactPerson.
5 6 7 8 9 |
# File 'lib/xero_gateway/contact_person.rb', line 5 def initialize(params = {}) params.each do |k,v| self.send("#{k}=", v) end end |
Instance Attribute Details
#email_address ⇒ Object
Returns the value of attribute email_address.
3 4 5 |
# File 'lib/xero_gateway/contact_person.rb', line 3 def email_address @email_address end |
#first_name ⇒ Object
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/xero_gateway/contact_person.rb', line 3 def first_name @first_name end |
#include_in_emails ⇒ Object
Returns the value of attribute include_in_emails.
3 4 5 |
# File 'lib/xero_gateway/contact_person.rb', line 3 def include_in_emails @include_in_emails end |
#last_name ⇒ Object
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/xero_gateway/contact_person.rb', line 3 def last_name @last_name end |
Class Method Details
.from_xml(contact_person_element) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/xero_gateway/contact_person.rb', line 20 def self.from_xml(contact_person_element) contact_person = ContactPerson.new contact_person_element.children.each do |element| case(element.name) when "FirstName" then contact_person.first_name = element.text when "LastName" then contact_person.last_name = element.text when "EmailAddress" then contact_person.email_address = element.text when "IncludeInEmails" then contact_person.include_in_emails = (element.text == "true") end end contact_person end |
Instance Method Details
#to_xml(b = Builder::XmlMarkup.new) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/xero_gateway/contact_person.rb', line 11 def to_xml(b = Builder::XmlMarkup.new) b.ContactPerson { b.FirstName first_name if first_name b.LastName last_name if last_name b.EmailAddress email_address if email_address b.IncludeInEmails include_in_emails if include_in_emails } end |