Class: NoSE::IndexDSL

Inherits:
Object show all
Defined in:
lib/nose/schema.rb

Overview

DSL for index creation within a schema

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#extraObject (readonly)

Returns the value of attribute extra.



52
53
54
# File 'lib/nose/schema.rb', line 52

def extra
  @extra
end

#hash_fieldsObject (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_fieldsObject (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_keysObject (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