Class: Ikra::Symbolic::ArrayCommand::ClassMethods::NormalCache
- Defined in:
- lib/types/types/array_command_type.rb
Instance Method Summary collapse
- #add_value(value) ⇒ Object
- #get_value(value) ⇒ Object
- #include?(value) ⇒ Boolean
-
#initialize ⇒ NormalCache
constructor
A new instance of NormalCache.
Constructor Details
#initialize ⇒ NormalCache
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
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
71 72 73 |
# File 'lib/types/types/array_command_type.rb', line 71 def include?(value) return @values.include?(value) end |