Class: NoSE::IndexDSL
Overview
DSL for index creation within a schema
Instance Attribute Summary collapse
-
#extra ⇒ Object
readonly
Returns the value of attribute extra.
-
#hash_fields ⇒ Object
readonly
Returns the value of attribute hash_fields.
-
#order_fields ⇒ Object
readonly
Returns the value of attribute order_fields.
-
#path_keys ⇒ Object
readonly
Returns the value of attribute path_keys.
Instance Method Summary collapse
-
#Extra(*fields) ⇒ void
Define a list of extra fields.
-
#Hash(*fields) ⇒ void
Define a list of hash fields.
-
#initialize(schema) ⇒ IndexDSL
constructor
A new instance of IndexDSL.
-
#Ordered(*fields) ⇒ void
Define a list of ordered fields.
-
#Path(*keys) ⇒ void
Define the keys for the index path.
Constructor Details
#initialize(schema) ⇒ IndexDSL
Returns a new instance of IndexDSL.
54 55 56 57 58 59 60 |
# File 'lib/nose/schema.rb', line 54 def initialize(schema) @schema = schema @hash_fields = [] @order_fields = [] @extra = [] @path_keys = [] end |
Instance Attribute Details
#extra ⇒ Object (readonly)
Returns the value of attribute extra.
52 53 54 |
# File 'lib/nose/schema.rb', line 52 def extra @extra end |
#hash_fields ⇒ Object (readonly)
Returns the value of attribute hash_fields.
52 53 54 |
# File 'lib/nose/schema.rb', line 52 def hash_fields @hash_fields end |
#order_fields ⇒ Object (readonly)
Returns the value of attribute order_fields.
52 53 54 |
# File 'lib/nose/schema.rb', line 52 def order_fields @order_fields end |
#path_keys ⇒ Object (readonly)
Returns the value of attribute path_keys.
52 53 54 |
# File 'lib/nose/schema.rb', line 52 def path_keys @path_keys end |
Instance Method Details
#Extra(*fields) ⇒ void
This method returns an undefined value.
Define a list of extra fields
78 79 80 |
# File 'lib/nose/schema.rb', line 78 def Extra(*fields) @extra += fields.flatten end |
#Hash(*fields) ⇒ void
This method returns an undefined value.
Define a list of hash fields
66 67 68 |
# File 'lib/nose/schema.rb', line 66 def Hash(*fields) @hash_fields += fields.flatten end |
#Ordered(*fields) ⇒ void
This method returns an undefined value.
Define a list of ordered fields
72 73 74 |
# File 'lib/nose/schema.rb', line 72 def Ordered(*fields) @order_fields += fields.flatten end |
#Path(*keys) ⇒ void
This method returns an undefined value.
Define the keys for the index path
84 85 86 |
# File 'lib/nose/schema.rb', line 84 def Path(*keys) @path_keys += keys end |