Sha256: ec7b6127adbad23153e7539247ca9b6a702cd97cb3c192f8eabdf952dfd21e81

Contents?: true

Size: 585 Bytes

Versions: 7

Compression:

Stored size: 585 Bytes

Contents

module Tufy
  module Fields
    module Address
      class BuildAddressTypeField < BuildField
        expects :raw_data
        promises :transformed_data

        executed do |ctx|
          ctx.transformed_data =
            ctx.transformed_data +
            transform(ctx).upcase
        end

        private

        def self.transform(ctx)
          raw_data = ctx.raw_data

          BuildAddressSegment::Constants::ADDRESS_TYPE_TAG +
            FormatStrings::F2TS % raw_data[:address_type].size +
              raw_data[:address_type]
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tufy-0.0.13 lib/tufy/fields/address/build_address_type_field.rb
tufy-0.0.12 lib/tufy/fields/address/build_address_type_field.rb
tufy-0.0.11 lib/tufy/fields/address/build_address_type_field.rb
tufy-0.0.10 lib/tufy/fields/address/build_address_type_field.rb
tufy-0.0.9 lib/tufy/fields/address/build_address_type_field.rb
tufy-0.0.8 lib/tufy/fields/address/build_address_type_field.rb
tufy-0.0.7 lib/tufy/fields/address/build_address_type_field.rb