Class: Validate::Compare::ToValue
- Inherits:
-
Object
- Object
- Validate::Compare::ToValue
- Includes:
- Comparable, TransformUsing
- Defined in:
- lib/validate/compare.rb
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(value_block) ⇒ ToValue
constructor
A new instance of ToValue.
- #to_s ⇒ Object
Methods included from TransformUsing
Constructor Details
#initialize(value_block) ⇒ ToValue
Returns a new instance of ToValue.
55 56 57 |
# File 'lib/validate/compare.rb', line 55 def initialize(value_block) @value_block = value_block end |
Instance Method Details
#<=>(other) ⇒ Object
59 60 61 |
# File 'lib/validate/compare.rb', line 59 def <=>(other) @value_block.call <=> other end |
#to_s ⇒ Object
63 64 65 |
# File 'lib/validate/compare.rb', line 63 def to_s '<dynamic value>' end |