Sha256: fdae19b6402164f3139536a8e128cd320cca0fa74d06cd4066449f9bc60bac1f

Contents?: true

Size: 745 Bytes

Versions: 13

Compression:

Stored size: 745 Bytes

Contents

module DummyAdapter
  class Adapter < NinjaModel::Adapters::AbstractAdapter
    extend ActiveSupport::Autoload

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

    def reconnect!
      disconnect!
      connect
    end

    def disconnect!
      nil
    end

    def connect
    end

    def create(model)
      execute :create, model
    end

    def read(query)
      execute :read, query
    end

    def update(model)
      execute :update, model
    end

    def destroy(model)
      execute :destroy, model
    end

    def reload(model)
      execute :reload, model
    end

    private

    def execute(method, object)
      raise NotImplementedError, "I should have been stubbed!"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ninja-model-1.0.5 spec/support/dummy_adapter/adapter.rb
ninja-model-1.0.4 spec/support/dummy_adapter/adapter.rb
ninja-model-1.0.3 spec/support/dummy_adapter/adapter.rb
ninja-model-1.0.2 spec/support/dummy_adapter/adapter.rb
ninja-model-1.0.1 spec/support/dummy_adapter/adapter.rb
ninja-model-1.0.0 spec/support/dummy_adapter/adapter.rb
ninja-model-0.9.6 spec/support/dummy_adapter/adapter.rb
ninja-model-0.9.5 spec/support/dummy_adapter/adapter.rb
ninja-model-0.9.4 spec/support/dummy_adapter/adapter.rb
ninja-model-0.9.3 spec/support/dummy_adapter/adapter.rb
ninja-model-0.9.2 spec/support/dummy_adapter/adapter.rb
ninja-model-0.9.1 spec/support/dummy_adapter/adapter.rb
ninja-model-0.9.0 spec/support/dummy_adapter/adapter.rb