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-1.0.5 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-1.0.4 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-1.0.3 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-1.0.2 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-1.0.1 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-1.0.0 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.9.6 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.9.5 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.9.4 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.9.3 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.9.2 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.9.1 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.9.0 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.8.1 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.8.0 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.7.3 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.7.2 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.7.1 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.7.0 lib/ninja_model/adapters/abstract_adapter.rb
ninja-model-0.6.2 lib/ninja_model/adapters/abstract_adapter.rb