Class: MarkLogic::DatabaseSettings::GeospatialElementIndex
- Inherits:
-
Object
- Object
- MarkLogic::DatabaseSettings::GeospatialElementIndex
- Defined in:
- lib/marklogic/database_settings/geospatial_element_index.rb
Instance Attribute Summary collapse
-
#facet ⇒ Object
Returns the value of attribute facet.
-
#localname ⇒ Object
Returns the value of attribute localname.
Instance Method Summary collapse
- #append_to_db(database) ⇒ Object
-
#initialize(element_name, options = {}) ⇒ GeospatialElementIndex
constructor
A new instance of GeospatialElementIndex.
- #key ⇒ Object
- #to_json(options = nil) ⇒ Object
Constructor Details
#initialize(element_name, options = {}) ⇒ GeospatialElementIndex
Returns a new instance of GeospatialElementIndex.
7 8 9 10 11 12 13 14 |
# File 'lib/marklogic/database_settings/geospatial_element_index.rb', line 7 def initialize(element_name, = {}) @localname = element_name @coordinate_system = [:coordinate_system] || MarkLogic::GEO_WGS84 @point_format = [:point_format] || MarkLogic::POINT @range_value_positions = [:range_value_positions] || false @invalid_values = [:invalid_values] || MarkLogic::REJECT @facet = [:facet] || false end |
Instance Attribute Details
#facet ⇒ Object
Returns the value of attribute facet.
5 6 7 |
# File 'lib/marklogic/database_settings/geospatial_element_index.rb', line 5 def facet @facet end |
#localname ⇒ Object
Returns the value of attribute localname.
5 6 7 |
# File 'lib/marklogic/database_settings/geospatial_element_index.rb', line 5 def localname @localname end |
Instance Method Details
#append_to_db(database) ⇒ Object
20 21 22 |
# File 'lib/marklogic/database_settings/geospatial_element_index.rb', line 20 def append_to_db(database) database.add_index("geospatial-element-index", self) end |
#key ⇒ Object
16 17 18 |
# File 'lib/marklogic/database_settings/geospatial_element_index.rb', line 16 def key %Q{#{self.class.to_s}-#{@localname}} end |
#to_json(options = nil) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/marklogic/database_settings/geospatial_element_index.rb', line 24 def to_json( = nil) { "geospatial-element-index" => { "namespace-uri" => "", "localname" => @localname, "coordinate-system" => @coordinate_system, "point-format" => @point_format, "range-value-positions" => @range_value_positions, "invalid-values" => @invalid_values } } end |