Sha256: 2e7a0bd140fddc1aab705c3b3c0e42da0baf27e868fffba5d54d5e1e216ce4b5

Contents?: true

Size: 778 Bytes

Versions: 15

Compression:

Stored size: 778 Bytes

Contents

module NetSuite
  module Support
    module Requests

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

      module ClassMethods

        def call(*args)
          new(*args).call
        end

      end

      def call
        @response = request
        build_response
      end

      private

      def request
        raise NotImplementedError
      end

      def connection
        Configuration.connection
      end

      def auth_header
        Configuration.auth_header
      end

      def build_response
        Response.new(:success => success?, :body => response_body)
      end

      def success?
        raise NotImplementedError
      end

      def response_body
        raise NotImplementedError
      end

    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
netsuite-0.0.26 lib/netsuite/support/requests.rb
netsuite-0.0.25 lib/netsuite/support/requests.rb
netsuite-0.0.23 lib/netsuite/support/requests.rb
netsuite-0.0.22 lib/netsuite/support/requests.rb
netsuite-0.0.21 lib/netsuite/support/requests.rb
netsuite-0.0.20 lib/netsuite/support/requests.rb
netsuite-0.0.19 lib/netsuite/support/requests.rb
netsuite-0.0.18 lib/netsuite/support/requests.rb
netsuite-0.0.17 lib/netsuite/support/requests.rb
netsuite-0.0.16 lib/netsuite/support/requests.rb
netsuite-0.0.15 lib/netsuite/support/requests.rb
netsuite-0.0.14 lib/netsuite/support/requests.rb
netsuite-0.0.13 lib/netsuite/support/requests.rb
netsuite-0.0.12 lib/netsuite/support/requests.rb
netsuite-0.0.11 lib/netsuite/support/requests.rb