Class: Mikon::Index
- Inherits:
-
Object
- Object
- Mikon::Index
- Extended by:
- Forwardable
- Defined in:
- lib/mikon/core/index.rb
Overview
Internal class for indexing
Instance Method Summary collapse
-
#initialize(source, options = {}) ⇒ Index
constructor
A new instance of Index.
- #sort_by(&block) ⇒ Object
Constructor Details
#initialize(source, options = {}) ⇒ Index
Returns a new instance of Index.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mikon/core/index.rb', line 9 def initialize(source, ={}) = { name: nil }.merge() case when source.is_a?(Array) @data = Mikon::DArray.new(source) when source.is_a?(Mikon::DArray) @data = source else raise ArgumentError end @name = [:name] end |