Class: MarkLogic::DatabaseSettings::GeospatialElementChildIndex

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent_localname, child_localname, options = {}) ⇒ GeospatialElementChildIndex

Returns a new instance of GeospatialElementChildIndex.


7
8
9
10
11
12
13
14
15
# File 'lib/marklogic/database_settings/geospatial_element_child_index.rb', line 7

def initialize(parent_localname, child_localname, options = {})
  @parent_localname = parent_localname
  @localname = child_localname
  @coordinate_system = options[:coordinate_system] || MarkLogic::GEO_WGS84
  @point_format = options[:point_format] || MarkLogic::POINT
  @range_value_positions = options[:range_value_positions] || false
  @invalid_values = options[:invalid_values] || MarkLogic::REJECT
  @facet = options[:facet] || false
end

Instance Attribute Details

#facetObject

Returns the value of attribute facet


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

def facet
  @facet
end

#localnameObject

Returns the value of attribute localname


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

def localname
  @localname
end

#parent_localnameObject

Returns the value of attribute parent_localname


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

def parent_localname
  @parent_localname
end

Instance Method Details

#append_to_db(database) ⇒ Object


21
22
23
# File 'lib/marklogic/database_settings/geospatial_element_child_index.rb', line 21

def append_to_db(database)
  database.add_index("geospatial-element-child-index", self)
end

#keyObject


17
18
19
# File 'lib/marklogic/database_settings/geospatial_element_child_index.rb', line 17

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

#to_json(options = nil) ⇒ Object


25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/marklogic/database_settings/geospatial_element_child_index.rb', line 25

def to_json(options = nil)
  {
    "geospatial-element-child-index" => {
      "parent-namespace-uri" => "",
      "parent-localname" => @parent_localname,
      "namespace-uri" => "",
      "localname" => @localname,
      "coordinate-system" => @coordinate_system,
      "point-format" => @point_format,
      "range-value-positions" => @range_value_positions,
      "invalid-values" => @invalid_values
    }
  }
end