Sha256: 68b304c5a6c30c5e540671ca1c05aa790eecbf5cfec90663d72bcd95fc5cd304

Contents?: true

Size: 1.66 KB

Versions: 7

Compression:

Stored size: 1.66 KB

Contents

module NetSuite
  module Support
    module Actions

      attr_accessor :errors

      def self.included(base)
        base.send(:extend, ClassMethods)
      end

      module ClassMethods

        def actions(*args)
          args.each do |action|
            action(action)
          end
        end

        def action(name)
          case name
          when :get
            self.send(:include, NetSuite::Actions::Get::Support)
          when :get_all
            self.send(:include, NetSuite::Actions::GetAll::Support)
          when :get_deleted
            self.send(:include, NetSuite::Actions::GetDeleted::Support)
          when :get_list
            self.send(:include, NetSuite::Actions::GetList::Support)
          when :get_select_value
            self.send(:include, NetSuite::Actions::GetSelectValue::Support)
          when :search
            self.send(:include, NetSuite::Actions::Search::Support)
          when :add
            self.send(:include, NetSuite::Actions::Add::Support)
          when :upsert
            self.send(:include, NetSuite::Actions::Upsert::Support)
          when :upsert_list
            self.send(:include, NetSuite::Actions::UpsertList::Support)
          when :delete
            self.send(:include, NetSuite::Actions::Delete::Support)
          when :delete_list
            self.send(:include, NetSuite::Actions::DeleteList::Support)
          when :update
            self.send(:include, NetSuite::Actions::Update::Support)
          when :initialize
            self.send(:include, NetSuite::Actions::Initialize::Support)
          else
            raise "Unknown action: #{name.inspect}"
          end
        end

      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
netsuite-0.8.2 lib/netsuite/support/actions.rb
netsuite-0.8.1 lib/netsuite/support/actions.rb
netsuite-0.8.0 lib/netsuite/support/actions.rb
netsuite-0.7.9 lib/netsuite/support/actions.rb
netsuite-0.7.8 lib/netsuite/support/actions.rb
netsuite-0.7.7 lib/netsuite/support/actions.rb
netsuite-0.7.6 lib/netsuite/support/actions.rb