Class: Usps::Imis::Panel::PanelProperties
- Inherits:
-
Object
- Object
- Usps::Imis::Panel::PanelProperties
- Defined in:
- lib/usps/imis/panel/panel_properties.rb
Overview
Constructor for the Properties field for Panel requests
Class Method Summary collapse
-
.build ⇒ Object
Build a new Properties field.
Instance Method Summary collapse
-
#add(name, value) ⇒ Object
Add an individual property to the field.
-
#build {|_self| ... } ⇒ Object
Build the Properties field.
Class Method Details
.build ⇒ Object
Build a new Properties field
11 |
# File 'lib/usps/imis/panel/panel_properties.rb', line 11 def self.build(&) = new.build(&) |
Instance Method Details
#add(name, value) ⇒ Object
Add an individual property to the field
28 29 30 31 32 33 34 35 |
# File 'lib/usps/imis/panel/panel_properties.rb', line 28 def add(name, value) @properties ||= [] @properties << { '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts', 'Name' => name, 'Value' => property_value(value) } end |
#build {|_self| ... } ⇒ Object
Build the Properties field
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/usps/imis/panel/panel_properties.rb', line 15 def build yield(self) { 'Properties' => { '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyDataCollection, Asi.Contracts', '$values' => @properties } } end |