Readme.md in usps-imis-api-0.1.3 vs Readme.md in usps-imis-api-0.2.0

- old
+ new

@@ -1,8 +1,8 @@ # USPS iMIS API for Ruby -![Gem Version](https://img.shields.io/gem/v/usps-imis-api) +[![Gem Version](https://img.shields.io/gem/v/usps-imis-api)](https://rubygems.org/gems/usps-imis-api) ## Installation Run this command: @@ -110,11 +110,11 @@ Update only specific fields on a business object for the current member `fields` is a hash of shape: `{ field_name => new_value }` ```ruby -api.put(business_object_name, fields) +api.put_fields(business_object_name, fields) ``` Run an IQA Query `query_params` is a hash of shape: `{ param_name => param_value }` @@ -130,24 +130,54 @@ ```ruby api.mapper.update(mm: 15) ``` +For simplicity, you can also call `update` on the `Api` class directly: + +```ruby +api.update(mm: 15) +``` + If there is no known mapping for the requested field, the Mapper will give up, but will provide you with the standard API call syntax, and will suggest you inform ITCom leadership of the new mapping you need. +### Panels + +For supported panels (usually, business objects with composite identity keys), you can interact +with them in the same general way: + +```ruby +vsc = Imis::Panel::Vsc.new + +vsc.api.imis_id = 6374 + +vsc.get(1417) + +created = vsc.create(certificate: 'E136924', year: 2024, count: 42) +ordinal = created['Properties']['$values'][1]['Value']['$value'] + +vsc.update(certificate: 'E136924', year: 2024, count: 43, ordinal: ordinal) + +vsc.destroy(ordinal) +``` + ### DSL Mode Instead of manually setting the current iMIS ID, then running individual queries, you can instead run queries in DSL mode. This specifies the iMIS ID for the scope of the block, then reverts to the previous value. ```ruby api.with(31092) do - # These two requests are identical: + # These three requests are identical: + put('ABC_ASC_Individual_Demog', { 'TotMMS' => 15 }) + mapper.update(mm: 15) + + update(mm: 15) end ``` ## Exception Handling