Class: Dryv::Rules::Equal

Inherits:
Binary show all
Defined in:
lib/dryv/rules/equal.rb

Instance Attribute Summary

Attributes inherited from Dryv::Rule

#args, #errors, #value

Instance Method Summary collapse

Methods inherited from Binary

#left, #right

Methods inherited from Dryv::Rule

#+, #add_error, #and, #clone, #initialize, #or, #then

Constructor Details

This class inherits a constructor from Dryv::Rule

Instance Method Details

#nameObject



12
13
14
# File 'lib/dryv/rules/equal.rb', line 12

def name
  'eq'
end

#valid?Boolean

Returns:

  • (Boolean)


5
6
7
8
9
# File 'lib/dryv/rules/equal.rb', line 5

def valid?
  return true if left.eql?(right)
  add_error
  false
end