Module: Validate::Compare

Defined in:
lib/validate/compare.rb

Defined Under Namespace

Modules: TransformUsing Classes: ToValue, WithAttributes

Class Method Summary collapse

Class Method Details

.attributes(**attributes) ⇒ Object



70
71
72
# File 'lib/validate/compare.rb', line 70

def attributes(**attributes)
  WithAttributes.new(attributes)
end

.to(value = nil, &value_block) ⇒ Object



74
75
76
77
# File 'lib/validate/compare.rb', line 74

def to(value = nil, &value_block)
  value_block ||= value.is_a?(Proc) ? value : proc { value }
  ToValue.new(value_block)
end