Method: CSquare::Indexable::InstanceMethods#index

Defined in:
lib/csquare.rb

#index(basename, options_and_mappings = {}) ⇒ Object



118
119
120
121
122
123
124
125
126
127
# File 'lib/csquare.rb', line 118

def index basename, options_and_mappings = {}
  @indices ||= Hash.new { |h,k| h[k] = [] }
  on        = options_and_mappings[:on]
  new_index = CSquare::Generator::Index.new(self, basename, expand_options(options_and_mappings))

  @externs[basename] = new_index.return_typename

  # Save the index by its enumerator id
  @indices[on || basename] << new_index
end