Class: Mal::ArrayT
Instance Method Summary collapse
- #===(value) ⇒ Object
-
#initialize(matcher_for_each_array_element) ⇒ ArrayT
constructor
A new instance of ArrayT.
- #inspect ⇒ Object
Methods inherited from OnlyT
Constructor Details
#initialize(matcher_for_each_array_element) ⇒ ArrayT
Returns a new instance of ArrayT.
169 170 171 |
# File 'lib/mal.rb', line 169 def initialize(matcher_for_each_array_element) @matcher_for_each_array_element = matcher_for_each_array_element end |
Instance Method Details
#===(value) ⇒ Object
173 174 175 176 177 178 179 180 |
# File 'lib/mal.rb', line 173 def ===(value) return false unless Array === value return false unless value.any? value.each do |value_element| return false unless @matcher_for_each_array_element === value_element end true end |
#inspect ⇒ Object
182 183 184 |
# File 'lib/mal.rb', line 182 def inspect 'ArrayOf(%s)' % @matcher_for_each_array_element.inspect end |