Sha256: 61bbccc9db7f4005e6e67f67ce5012b7d17685e5b3ba2654d8a888acff955948

Contents?: true

Size: 606 Bytes

Versions: 2

Compression:

Stored size: 606 Bytes

Contents

module NetSuite
  module Records
    class CustomFieldList
      include Namespaces::PlatformCore

      def initialize(attributes = {})
        case attributes[:custom_field]
        when Hash
          custom_fields << CustomField.new(attributes[:custom_field])
        when Array
          attributes[:custom_field].each { |custom_field| custom_fields << CustomField.new(addressbook) }
        end
      end

      def custom_fields
        @custom_fields ||= []
      end

      def to_record
        { "#{record_namespace}:customField" => custom_fields.map(&:to_record) }
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
netsuite-0.0.16 lib/netsuite/records/custom_field_list.rb
netsuite-0.0.15 lib/netsuite/records/custom_field_list.rb