Class: CPS::Contact
- Inherits:
-
Object
- Object
- CPS::Contact
- Defined in:
- lib/cps-client/contact.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #domain ⇒ Object
-
#get_binding ⇒ Object
this is only a helper method to access the objects binding method.
- #info ⇒ Object
-
#initialize(options = {}) ⇒ Contact
constructor
A new instance of Contact.
Constructor Details
#initialize(options = {}) ⇒ Contact
Returns a new instance of Contact.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cps-client/contact.rb', line 8 def initialize( = {}) @object = [:object].upcase @firstname = [:firstname].to_iso_8859_1 @lastname = [:lastname].to_iso_8859_1 @orgname = [:orgname].nil? || [:orgname] == "" ? "-" : [:orgname].to_iso_8859_1 @street = [:street].to_iso_8859_1 @postal = [:postal].to_iso_8859_1 @city = [:city].to_iso_8859_1 @state = [:state].to_iso_8859_1 @iso_country = [:iso_country].to_iso_8859_1 @phone = [:phone].to_iso_8859_1 @fax = [:fax].to_iso_8859_1 @email = [:email].to_punycode @privacy_rule = [:privacy_rule] || "" @contact_type = @orgname == '-' ? "person" : "organisation" end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
6 7 8 |
# File 'lib/cps-client/contact.rb', line 6 def object @object end |
Instance Method Details
#create ⇒ Object
29 30 31 |
# File 'lib/cps-client/contact.rb', line 29 def create ErbHelper.build("contact_create", self) end |
#delete ⇒ Object
33 34 35 |
# File 'lib/cps-client/contact.rb', line 33 def delete ErbHelper.build("contact_delete", self) end |
#domain ⇒ Object
37 38 39 |
# File 'lib/cps-client/contact.rb', line 37 def domain ErbHelper.build("contact_domain", self) end |
#get_binding ⇒ Object
this is only a helper method to access the objects binding method
42 43 44 |
# File 'lib/cps-client/contact.rb', line 42 def get_binding binding end |