Class: Ikra::Symbolic::ArrayCommand::ClassMethods::NormalCache

Inherits:
Object
  • Object
show all
Defined in:
lib/types/types/array_command_type.rb

Instance Method Summary collapse

Constructor Details

#initializeNormalCache

Returns a new instance of NormalCache.



53
54
55
# File 'lib/types/types/array_command_type.rb', line 53

def initialize
    @values = []
end

Instance Method Details

#add_value(value) ⇒ Object



67
68
69
# File 'lib/types/types/array_command_type.rb', line 67

def add_value(value)
    @values.push(value)
end

#get_value(value) ⇒ Object

Raises:

  • (RuntimeError)


57
58
59
60
61
62
63
64
65
# File 'lib/types/types/array_command_type.rb', line 57

def get_value(value)
    for el in @values
        if el == value
            return el
        end
    end

    raise RuntimeError.new("Value not found")
end

#include?(value) ⇒ Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/types/types/array_command_type.rb', line 71

def include?(value)
    return @values.include?(value)
end