Class: Usps::Imis::Panel::Vsc
- Inherits:
-
Object
- Object
- Usps::Imis::Panel::Vsc
- Defined in:
- lib/usps/imis/panel/vsc.rb
Constant Summary collapse
- BUSINESS_OBJECT =
'ABC_ASC_Vessel_Safety_Checks'
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
Instance Method Summary collapse
- #create(data) ⇒ Object
- #destroy(ordinal) ⇒ Object
- #get(ordinal) ⇒ Object
-
#initialize(api = nil) ⇒ Vsc
constructor
A new instance of Vsc.
- #update(data) ⇒ Object
Constructor Details
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
9 10 11 |
# File 'lib/usps/imis/panel/vsc.rb', line 9 def api @api end |
Instance Method Details
#create(data) ⇒ Object
19 20 21 |
# File 'lib/usps/imis/panel/vsc.rb', line 19 def create(data) api.post(BUSINESS_OBJECT, payload(data), url_id: '') end |
#destroy(ordinal) ⇒ Object
27 28 29 |
# File 'lib/usps/imis/panel/vsc.rb', line 27 def destroy(ordinal) api.delete(BUSINESS_OBJECT, url_id: "~#{api.imis_id}|#{ordinal}") end |
#get(ordinal) ⇒ Object
15 16 17 |
# File 'lib/usps/imis/panel/vsc.rb', line 15 def get(ordinal) api.get(BUSINESS_OBJECT, url_id: "~#{api.imis_id}|#{ordinal}") end |
#update(data) ⇒ Object
23 24 25 |
# File 'lib/usps/imis/panel/vsc.rb', line 23 def update(data) api.put(BUSINESS_OBJECT, payload(data), url_id: "~#{api.imis_id}|#{data[:ordinal]}") end |