Class: Usps::Imis::Panel::BasePanel
- Inherits:
-
Object
- Object
- Usps::Imis::Panel::BasePanel
- Defined in:
- lib/usps/imis/panel/base_panel.rb
Overview
Base class for configuring Panels
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
The parent
Apiobject.
Instance Method Summary collapse
-
#create(data) ⇒ Object
Create a new object in the Panel.
-
#destroy(ordinal) ⇒ Object
Remove a specific object from the Panel.
-
#get(ordinal) ⇒ Object
Get a specific object from the Panel.
-
#initialize(api = nil, imis_id: nil) ⇒ BasePanel
constructor
A new instance of BasePanel.
-
#update(data) ⇒ Object
Update an existing object in the Panel.
Constructor Details
Instance Attribute Details
#api ⇒ Object (readonly)
The parent Api object
11 12 13 |
# File 'lib/usps/imis/panel/base_panel.rb', line 11 def api @api end |
Instance Method Details
#create(data) ⇒ Object
Create a new object in the Panel
30 31 32 |
# File 'lib/usps/imis/panel/base_panel.rb', line 30 def create(data) api.post(business_object, payload(data), url_id: '') end |
#destroy(ordinal) ⇒ Object
Remove a specific object from the Panel
47 48 49 |
# File 'lib/usps/imis/panel/base_panel.rb', line 47 def destroy(ordinal) api.delete(business_object, url_id: "~#{api.imis_id}|#{ordinal}") end |
#get(ordinal) ⇒ Object
Get a specific object from the Panel
22 23 24 |
# File 'lib/usps/imis/panel/base_panel.rb', line 22 def get(ordinal) api.get(business_object, url_id: "~#{api.imis_id}|#{ordinal}") end |
#update(data) ⇒ Object
Update an existing object in the Panel
39 40 41 |
# File 'lib/usps/imis/panel/base_panel.rb', line 39 def update(data) api.put(business_object, payload(data), url_id: "~#{api.imis_id}|#{data[:ordinal]}") end |