Sha256: ae8c3f9d5f27efa13f34e71ed5ce6f2ee5ac45eef994ee311b97b330a0f01bbe

Contents?: true

Size: 615 Bytes

Versions: 32

Compression:

Stored size: 615 Bytes

Contents

module Centaman
  class Service::CreateUdf < Centaman::Service
    attr_reader :udfs, :member_code

    def after_init(args)
      @udfs = args.fetch(:udfs, [])
      @member_code = args[:member_code]
    end

    def endpoint
      "/udf_services/UDFMember?memberCode=#{member_code}"
    end

    def build_udf_body(udf)
      {
        'Value': udf.value,
        'FieldName': udf.field_name,
        'FieldType': udf.field_type,
        'FieldLength': udf.field_length,
        'TabName': udf.tab_name,
      }
    end

    def options_hash
      udfs.map { |udf| build_udf_body(udf) }.to_json
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
centaman-8.0.0 lib/centaman/service/create_udf.rb
centaman-7.0.5 lib/centaman/service/create_udf.rb
centaman-7.0.4 lib/centaman/service/create_udf.rb
centaman-7.0.3 lib/centaman/service/create_udf.rb
centaman-7.0.2 lib/centaman/service/create_udf.rb
centaman-7.0.1 lib/centaman/service/create_udf.rb
centaman-7.0.0 lib/centaman/service/create_udf.rb
centaman-6.0.8 lib/centaman/service/create_udf.rb
centaman-6.0.7 lib/centaman/service/create_udf.rb
centaman-6.0.5 lib/centaman/service/create_udf.rb
centaman-6.0.4 lib/centaman/service/create_udf.rb
centaman-6.0.3 lib/centaman/service/create_udf.rb
centaman-6.0.2 lib/centaman/service/create_udf.rb
centaman-6.0.1 lib/centaman/service/create_udf.rb
centaman-6.0.0 lib/centaman/service/create_udf.rb
centaman-5.0.8 lib/centaman/service/create_udf.rb
centaman-5.0.7 lib/centaman/service/create_udf.rb
centaman-5.0.6 lib/centaman/service/create_udf.rb
centaman-5.0.5 lib/centaman/service/create_udf.rb
centaman-5.0.4 lib/centaman/service/create_udf.rb