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