Class: CPS::Contact

Inherits:
Object
  • Object
show all
Defined in:
lib/cps-client/contact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  @object       = options[:object].upcase
  @firstname    = options[:firstname].to_iso_8859_1
  @lastname     = options[:lastname].to_iso_8859_1
  @orgname      = options[:orgname].nil? || options[:orgname] == "" ? "-" : options[:orgname].to_iso_8859_1
  @street       = options[:street].to_iso_8859_1
  @postal       = options[:postal].to_iso_8859_1
  @city         = options[:city].to_iso_8859_1
  @state        = options[:state].to_iso_8859_1
  @iso_country  = options[:iso_country].to_iso_8859_1
  @phone        = options[:phone].to_iso_8859_1
  @fax          = options[:fax].to_iso_8859_1
  @email        = options[:email].to_punycode
  @privacy_rule = options[:privacy_rule] || ""
  @contact_type = @orgname == '-' ? "person" : "organisation"
end

Instance Attribute Details

#objectObject (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

#createObject



29
30
31
# File 'lib/cps-client/contact.rb', line 29

def create
  ErbHelper.build("contact_create", self)
end

#deleteObject



33
34
35
# File 'lib/cps-client/contact.rb', line 33

def delete
  ErbHelper.build("contact_delete", self)
end

#domainObject



37
38
39
# File 'lib/cps-client/contact.rb', line 37

def domain
  ErbHelper.build("contact_domain", self)
end

#get_bindingObject

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

#infoObject



25
26
27
# File 'lib/cps-client/contact.rb', line 25

def info
  ErbHelper.build("contact_info", self)
end