Sha256: 2be3b55ef65c4c7f1d86d80b620a4e53bad89849d759d0dcdb343add9bc7960c

Contents?: true

Size: 786 Bytes

Versions: 29

Compression:

Stored size: 786 Bytes

Contents

module NinjaModel
  module Adapters
    class AbstractAdapter
      attr_reader :config

      def initialize(config, logger = nil)
        @active = false
        @config, @logger = config, logger
      end

      def adapter_name
        'Abstract'
      end

      def persistent_connection?
        true
      end

      def active?
        @active != false
      end

      def reconnect!
        @active = true
      end

      def disconnect!
        @active = false
      end

      def reset!
      end

      def verify!
        reconnect! unless active?
      end

      def create(model)
        false
      end

      def read(query)
        nil
      end

      def update(model)
        false
      end

      def destroy(model)
        false
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
ninja-model-0.6.1 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.6.0 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.5.7 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.5.6 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.5.5 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.5.4 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.5.3 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.5.2 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.5.1 lib/ninja_model/adapters/abstract_adapter.rb