Class: MarkLogic::DatabaseSettings::RangeFieldIndex
- Inherits:
-
Object
- Object
- MarkLogic::DatabaseSettings::RangeFieldIndex
- Defined in:
- lib/marklogic/database_settings/range_field_index.rb
Instance Attribute Summary collapse
-
#collation ⇒ Object
Returns the value of attribute collation.
-
#facet ⇒ Object
Returns the value of attribute facet.
-
#field_name ⇒ Object
Returns the value of attribute field_name.
-
#scalar_type ⇒ Object
Returns the value of attribute scalar_type.
Instance Method Summary collapse
- #append_to_db(database) ⇒ Object
-
#initialize(field_name, options = {}) ⇒ RangeFieldIndex
constructor
A new instance of RangeFieldIndex.
- #key ⇒ Object
- #to_json(options = nil) ⇒ Object
Constructor Details
#initialize(field_name, options = {}) ⇒ RangeFieldIndex
Returns a new instance of RangeFieldIndex.
7 8 9 10 11 12 13 14 |
# File 'lib/marklogic/database_settings/range_field_index.rb', line 7 def initialize(field_name, = {}) @scalar_type = [:type] || MarkLogic::STRING @field_name = field_name @collation = [:collation] || DEFAULT_COLLATION @range_value_positions = [:range_value_positions] || false @invalid_values = [:invalid_values] || MarkLogic::REJECT @facet = [:facet] || false end |
Instance Attribute Details
#collation ⇒ Object
Returns the value of attribute collation.
5 6 7 |
# File 'lib/marklogic/database_settings/range_field_index.rb', line 5 def collation @collation end |
#facet ⇒ Object
Returns the value of attribute facet.
5 6 7 |
# File 'lib/marklogic/database_settings/range_field_index.rb', line 5 def facet @facet end |
#field_name ⇒ Object
Returns the value of attribute field_name.
5 6 7 |
# File 'lib/marklogic/database_settings/range_field_index.rb', line 5 def field_name @field_name end |
#scalar_type ⇒ Object
Returns the value of attribute scalar_type.
5 6 7 |
# File 'lib/marklogic/database_settings/range_field_index.rb', line 5 def scalar_type @scalar_type end |
Instance Method Details
#append_to_db(database) ⇒ Object
20 21 22 |
# File 'lib/marklogic/database_settings/range_field_index.rb', line 20 def append_to_db(database) database.add_index("range-field-index", self) end |
#key ⇒ Object
16 17 18 |
# File 'lib/marklogic/database_settings/range_field_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 |
# File 'lib/marklogic/database_settings/range_field_index.rb', line 24 def to_json( = nil) { "range-field-index" => { "scalar-type" => @scalar_type, "field-name" => @field_name, "collation" => @collation, "range-value-positions" => @range_value_positions, "invalid-values" => @invalid_values } } end |