Class: Val::ArrayCondition
- Inherits:
-
Object
- Object
- Val::ArrayCondition
- Defined in:
- lib/val.rb
Instance Method Summary collapse
- #===(value) ⇒ Object
-
#initialize(name, array) ⇒ ArrayCondition
constructor
A new instance of ArrayCondition.
Constructor Details
#initialize(name, array) ⇒ ArrayCondition
Returns a new instance of ArrayCondition.
76 77 78 |
# File 'lib/val.rb', line 76 def initialize name, array @name, @proc = name, array.to_proc end |
Instance Method Details
#===(value) ⇒ Object
80 81 82 83 84 |
# File 'lib/val.rb', line 80 def === value @proc === value[@name] rescue ArgumentError false end |