Module: SAFT::V2::Types::Sliced

Extended by:
ObjectStrutures
Defined in:
lib/saft/v2/types.rb

Constant Summary collapse

ISOCurrencyCode =
Types.Constructor(Strict::ISOCurrencyCode, &slice_string(3))
ISOCountryCode =
Types.Constructor(Strict::ISOCountryCode, &slice_string(2))
SAFcodeType =
Types.Constructor(Strict::SAFcodeType, &slice_string(9))
SAFshorttextType =
Types.Constructor(Strict::SAFshorttextType, &slice_string(18))
SAFmiddle1textType =
Types.Constructor(Strict::SAFmiddle1textType, &slice_string(35))
SAFmiddle2textType =
Types.Constructor(Strict::SAFmiddle2textType, &slice_string(70))
SAFlongtextType =
Types.Constructor(Strict::SAFlongtextType, &slice_string(256))
SAFmonetaryType =
Strict::SAFmonetaryType
SAFexchangerateType =
Strict::SAFexchangerateType
SAFquantityType =
Strict::SAFquantityType
SAFweightType =
Strict::SAFweightType
AddressType =
Strict::AddressType

Class Method Summary collapse

Methods included from ObjectStrutures

extended

Class Method Details

.slice_string(length) ⇒ Object



462
463
464
465
466
467
468
469
470
# File 'lib/saft/v2/types.rb', line 462

def self.slice_string(length)
  proc do |value|
    if value.is_a?(::String)
      value.slice(0, length)
    else
      value
    end
  end
end