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 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.
Methods inherited from BaseData
#[]=, from_json, #inspect, #pretty_print
Instance Method Details
#[](property_name) ⇒ Object
Access an individual property value by name
29 |
# File 'lib/usps/imis/party_data.rb', line 29 def [](property_name) = properties[property_name] |
#certificate ⇒ Object
Access the certificate number
25 |
# File 'lib/usps/imis/party_data.rb', line 25 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
33 34 35 |
# File 'lib/usps/imis/party_data.rb', line 33 def properties @properties ||= format_extracted(extract_hash(raw)) end |