Sha256: ba5e689c77cc147c7b43bff73a0af549cb19badc93f954b8af7af1616667b3e1

Contents?: true

Size: 567 Bytes

Versions: 4

Compression:

Stored size: 567 Bytes

Contents

module NetSuite
  module RecordRefSupport

    def self.included(base)
      base.extend(ClassMethods)
    end

    module ClassMethods

      def record_refs(*names)
        names.each do |name|
          record_ref name
        end
      end

      def record_ref(name)
        name_sym = name.to_sym
        fields << name_sym
        define_method "#{name}=" do |attrs|
          attributes[name_sym] = NetSuite::Records::RecordRef.new(attrs)
        end

        define_method name_sym do
          attributes[name_sym]
        end
      end

    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
netsuite-0.0.10 lib/netsuite/record_ref_support.rb
netsuite-0.0.9 lib/netsuite/record_ref_support.rb
netsuite-0.0.8 lib/netsuite/record_ref_support.rb
netsuite-0.0.7 lib/netsuite/record_ref_support.rb