Class: Rawscsi::IndexHelpers::SdfAdd

Inherits:
Object
  • Object
show all
Defined in:
lib/rawscsi/index_helpers/sdf_add.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc, attributes = nil) ⇒ SdfAdd

Returns a new instance of SdfAdd.



6
7
8
9
# File 'lib/rawscsi/index_helpers/sdf_add.rb', line 6

def initialize(doc, attributes=nil) 
  @doc = doc
  @attributes = attributes || doc.keys
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



4
5
6
# File 'lib/rawscsi/index_helpers/sdf_add.rb', line 4

def attributes
  @attributes
end

#docObject (readonly)

Returns the value of attribute doc.



4
5
6
# File 'lib/rawscsi/index_helpers/sdf_add.rb', line 4

def doc
  @doc
end

Instance Method Details

#buildObject



11
12
13
14
15
16
17
# File 'lib/rawscsi/index_helpers/sdf_add.rb', line 11

def build
  {
    :id => doc_id,
    :type => "add",
    :fields => fields
  }
end