Class: PikoStore::BaseDocument

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/piko_store/base_document.rb

Direct Known Subclasses

Document, Filter

Instance Method Summary collapse

Methods included from Logger

#logger

Constructor Details

#initialize(data) ⇒ BaseDocument

Returns a new instance of BaseDocument.



27
28
29
30
# File 'lib/piko_store/base_document.rb', line 27

def initialize(data)
  @data = data
  logger.debug { format "%s", to_h }
end

Instance Method Details

#idObject

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/piko_store/base_document.rb', line 32

def id
  raise NotImplementedError
end

#to_hObject

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/piko_store/base_document.rb', line 36

def to_h
  raise NotImplementedError
end

#to_hashObject



40
41
42
# File 'lib/piko_store/base_document.rb', line 40

def to_hash
  to_h
end

#to_sObject



44
45
46
# File 'lib/piko_store/base_document.rb', line 44

def to_s
  to_h.to_s
end