Class: MarkLogic::DatabaseSettings::ElementWordLexicon

Inherits:
Object
  • Object
show all
Defined in:
lib/marklogic/database_settings/element_word_lexicon.rb

Instance Method Summary collapse

Constructor Details

#initialize(localname, collation = DEFAULT_COLLATION) ⇒ ElementWordLexicon

Returns a new instance of ElementWordLexicon.


4
5
6
7
# File 'lib/marklogic/database_settings/element_word_lexicon.rb', line 4

def initialize(localname, collation = DEFAULT_COLLATION)
  @localname = localname
  @collation = collation
end

Instance Method Details

#append_to_db(database) ⇒ Object


9
10
11
# File 'lib/marklogic/database_settings/element_word_lexicon.rb', line 9

def append_to_db(database)
  database.add_index("element-word-lexicon", self)
end

#keyObject


13
14
15
# File 'lib/marklogic/database_settings/element_word_lexicon.rb', line 13

def key
  %Q{#{self.class.to_s}-#{@localname}}
end

#to_json(options = nil) ⇒ Object


17
18
19
20
21
22
23
24
25
# File 'lib/marklogic/database_settings/element_word_lexicon.rb', line 17

def to_json(options = nil)
  {
    "element-word-lexicon" => {
      "namespace-uri" => "",
      "localname" => @localname,
      "collation" => @collation
    }
  }
end