Class: Usps::Imis::PartyData
- Defined in:
- lib/usps/imis/party_data.rb
Overview
Convenience wrapper for accessing specific properties within an API data response for the Party Business Object, which has a different internal structure than others
Instance Attribute Summary
Attributes inherited from BaseData
Instance Method Summary collapse
-
#[](property_name) ⇒ Object
Access an individual property value by name.
-
#certificate ⇒ Object
Access the certificate number.
-
#entity ⇒ Object
The Business Object name.
-
#imis_id ⇒ Object
(also: #id)
Access the iMIS ID property.
-
#properties ⇒ Object
Hash of all property names to values.
-
#uniform_id ⇒ Object
(also: #uuid)
Access the Uniform ID (uuid) property.
Methods inherited from BaseData
#==, [], #[]=, from_json, #initialize, #inspect, #pretty_print, #record_id
Constructor Details
This class inherits a constructor from Usps::Imis::BaseData
Instance Method Details
#[](property_name) ⇒ Object
Access an individual property value by name
34 |
# File 'lib/usps/imis/party_data.rb', line 34 def [](property_name) = properties[property_name] |
#certificate ⇒ Object
Access the certificate number
30 |
# File 'lib/usps/imis/party_data.rb', line 30 def certificate = self['AlternateIds'].find { it['IdType'] == 'MajorKey' }['Id'] |
#entity ⇒ Object
The Business Object name
16 |
# File 'lib/usps/imis/party_data.rb', line 16 def entity = 'Party' |
#imis_id ⇒ Object Also known as: id
Access the iMIS ID property
20 |
# File 'lib/usps/imis/party_data.rb', line 20 def imis_id = self['Id'].to_i |
#properties ⇒ Object
Hash of all property names to values
38 39 40 |
# File 'lib/usps/imis/party_data.rb', line 38 def properties @properties ||= format_extracted(extract_hash(raw)) end |
#uniform_id ⇒ Object Also known as: uuid
Access the Uniform ID (uuid) property
25 |
# File 'lib/usps/imis/party_data.rb', line 25 def uniform_id = self['UniformId'] |