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.
- #replace ⇒ Object
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] rescue nil @lastname = [:lastname] rescue nil @orgname = [:orgname].nil? || [:orgname] == "" ? "-" : [:orgname] rescue nil @street = [:street] rescue nil @postal = [:postal] rescue nil @city = [:city] rescue nil @state = [:state] rescue nil @iso_country = [:iso_country].upcase rescue nil @phone = [:phone] rescue nil @fax = [:fax] rescue nil @email = [:email].to_punycode rescue nil @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
37 38 39 |
# File 'lib/cps-client/contact.rb', line 37 def delete ErbHelper.build("contact_delete", self) end |
#domain ⇒ Object
41 42 43 |
# File 'lib/cps-client/contact.rb', line 41 def domain ErbHelper.build("contact_domain", self) end |
#get_binding ⇒ Object
this is only a helper method to access the objects binding method
46 47 48 |
# File 'lib/cps-client/contact.rb', line 46 def get_binding binding end |