Class: OpenSRS::Contact

Inherits:
Struct
  • Object
show all
Defined in:
lib/opensrs/contact.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#address1Object

Returns the value of attribute address1

Returns:

  • (Object)

    the current value of address1



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def address1
  @address1
end

#address2Object

Returns the value of attribute address2

Returns:

  • (Object)

    the current value of address2



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def address2
  @address2
end

#cityObject

Returns the value of attribute city

Returns:

  • (Object)

    the current value of city



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def city
  @city
end

#countryObject

Returns the value of attribute country

Returns:

  • (Object)

    the current value of country



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def country
  @country
end

#emailObject

Returns the value of attribute email

Returns:

  • (Object)

    the current value of email



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name

Returns:

  • (Object)

    the current value of first_name



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name

Returns:

  • (Object)

    the current value of last_name



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def last_name
  @last_name
end

#org_nameObject

Returns the value of attribute org_name

Returns:

  • (Object)

    the current value of org_name



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def org_name
  @org_name
end

#phoneObject

Returns the value of attribute phone

Returns:

  • (Object)

    the current value of phone



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def phone
  @phone
end

#postal_codeObject

Returns the value of attribute postal_code

Returns:

  • (Object)

    the current value of postal_code



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def postal_code
  @postal_code
end

#stateObject

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



2
3
4
# File 'lib/opensrs/contact.rb', line 2

def state
  @state
end

Class Method Details

.from_hash(hash) ⇒ Object



7
8
9
# File 'lib/opensrs/contact.rb', line 7

def self.from_hash(hash)
  new(**hash.transform_keys(&:to_sym).slice(*members))
end

Instance Method Details

#to_api_hashObject



11
12
13
# File 'lib/opensrs/contact.rb', line 11

def to_api_hash
  to_h.compact.transform_keys(&:to_s)
end