class

Nucleoc::Snapshot(T)

Inherits Reference < Object

A read-only snapshot of match results.

Constructors

new(items : Boxcar(T), matches : Array(Match), pattern : MultiPattern, item_count : UInt32)
Source

Instance methods

get_item(index : UInt32) : Item(T) | Nil

Returns a reference to the item at the given index.

Source
get_matched_item(n : UInt32) : Item(T) | Nil

Returns the item corresponding to the nth match.

Source
item_count

Returns the total number of items in the snapshot.

Source
items
Source
matched_item_count

Returns the number of items that matched the pattern.

Source
matched_items(range : Range(Int32 | Nil, Int32 | Nil)) : Array(Item(T))

Returns an iterator over matched items in the given range.

Source
matches

Returns the matches in this snapshot.

Source
pattern

Returns the pattern which items were matched against.

Source