class Matching::ArrayStore

Stores and retrieves data from arrays for Matcher

Attributes

arr[R]

Public Class Methods

new(arr) click to toggle source
# File lib/matching/array_store.rb, line 8
def initialize(arr)
  @arr = arr
end

Public Instance Methods

each(&blk) click to toggle source

Iterates over array, also returning index as a kind of ID

# File lib/matching/array_store.rb, line 13
def each(&blk)
  @arr.each_with_index(&blk)
end
find(idx) click to toggle source

Return an object from the array by its index position

# File lib/matching/array_store.rb, line 18
def find(idx)
  @arr[idx]
end