Class: Rawscsi::IndexHelpers::SdfAdd
- Inherits:
-
Object
- Object
- Rawscsi::IndexHelpers::SdfAdd
- Defined in:
- lib/rawscsi/index_helpers/sdf_add.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(doc, attributes = nil) ⇒ SdfAdd
constructor
A new instance of SdfAdd.
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
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/rawscsi/index_helpers/sdf_add.rb', line 4 def attributes @attributes end |
#doc ⇒ Object (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
#build ⇒ Object
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 |