Sha256: 23112414131328c68e52b05b3aaa64a2f5423fef12a50c3b94a60d4e95768b8c

Contents?: true

Size: 896 Bytes

Versions: 1

Compression:

Stored size: 896 Bytes

Contents

# encoding: UTF-8

module Esearch
  # Handler for document
  class Document
    include Adamantium::Flat, Concord.new(:type, :id)
    include Mixin::Exist, Mixin::Document

    # Delete document
    #
    # @return [Presenter::Command::Document::Delete]
    #
    # @api private
    #
    def delete
      Command::Document::Delete.run(self)
    end

    # Return document
    #
    # @return [Presenter::Command::Document::Get]
    #   if foundd
    #
    # @return [nil]
    #   otherwise
    #
    # @api private
    #
    def get
      Command::Document::Get.run(self)
    end

    # Return path
    #
    # @return [Pathname]
    #
    # @api private
    #
    def path
      type.path.join(id)
    end
    memoize :path

    # Return connection
    #
    # @return [Connection]
    #
    # @api private
    #
    def connection
      type.connection
    end

  end # Document
end # Esearch

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esearch-0.2.2 lib/esearch/document.rb