Class: Usps::Imis::BlankObject

Inherits:
Object
  • Object
show all
Defined in:
lib/usps/imis/blank_object.rb

Overview

Constructor for blank BusinessObject and BasePanel objects

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, ordinal = nil) ⇒ BlankObject

Returns a new instance of BlankObject.



16
17
18
19
# File 'lib/usps/imis/blank_object.rb', line 16

def initialize(parent, ordinal = nil)
  @parent = parent
  @ordinal = ordinal
end

Instance Attribute Details

#parentObject (readonly)

The parent object



14
15
16
# File 'lib/usps/imis/blank_object.rb', line 14

def parent
  @parent
end

Instance Method Details

#build(hash = {}) {|| ... } ⇒ Object

Build a blank object for the current iMIS ID

Parameters:

  • hash (Hash) (defaults to: {})

    Hash version of props to set (block takes priority)

Yields:

  • Block context to define additional properties with add

Yield Parameters:



27
# File 'lib/usps/imis/blank_object.rb', line 27

def build(hash = {}, &) = header.merge(Properties.build(parent.api.record_id.to_s, @ordinal&.to_s, hash, &))