Class: MarkLogic::DatabaseSettings::ElementWordLexicon
- Inherits:
-
Object
- Object
- MarkLogic::DatabaseSettings::ElementWordLexicon
- Defined in:
- lib/marklogic/database_settings/element_word_lexicon.rb
Instance Method Summary collapse
- #append_to_db(database) ⇒ Object
-
#initialize(localname, collation = DEFAULT_COLLATION) ⇒ ElementWordLexicon
constructor
A new instance of ElementWordLexicon.
- #key ⇒ Object
- #to_json(options = nil) ⇒ Object
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 |
#key ⇒ Object
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( = nil) { "element-word-lexicon" => { "namespace-uri" => "", "localname" => @localname, "collation" => @collation } } end |