Module: Gecode::Util::VarStoreMethods
- Included in:
- BoolVarStore, IntVarStore, SetVarStore
- Defined in:
- lib/gecoder/interface/binding_changes.rb
Overview
Provides common methods to the variable stores. The stores must provide @next_index, @var_array, @size, ARRAY_IDENTIFIER and #new_storage_array .
Instance Method Summary collapse
-
#[](index) ⇒ Object
Returns the int var with the specified index, nil if none exists.
Instance Method Details
#[](index) ⇒ Object
Returns the int var with the specified index, nil if none exists.
101 102 103 104 105 106 |
# File 'lib/gecoder/interface/binding_changes.rb', line 101 def [](index) if index < 0 or index >= @next_index return nil end return @var_array.at(index) end |