Class: Lycra::Multidoc

Inherits:
Object
  • Object
show all
Defined in:
lib/lycra/multidoc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*documents) ⇒ Multidoc

Returns a new instance of Multidoc.



5
6
7
8
# File 'lib/lycra/multidoc.rb', line 5

def initialize(*documents)
  @documents = documents.flatten
  @documents = Lycra::Document::Registry.all if @documents.empty?
end

Instance Attribute Details

#documentsObject (readonly)

Returns the value of attribute documents.



3
4
5
# File 'lib/lycra/multidoc.rb', line 3

def documents
  @documents
end

Instance Method Details

#clientObject



18
19
20
# File 'lib/lycra/multidoc.rb', line 18

def client
  Lycra.client
end

#document_typeObject



14
15
16
# File 'lib/lycra/multidoc.rb', line 14

def document_type
  documents.map { |d| d.document_type }
end

#index_nameObject



10
11
12
# File 'lib/lycra/multidoc.rb', line 10

def index_name
  documents.map { |d| d.alias_name }
end