Class: Dry::Validation::Message

Inherits:
Struct
  • Object
show all
Defined in:
lib/dry/validation/error_compiler/input.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#predicateObject

Returns the value of attribute predicate

Returns:

  • (Object)

    the current value of predicate



5
6
7
# File 'lib/dry/validation/error_compiler/input.rb', line 5

def predicate
  @predicate
end

#ruleObject

Returns the value of attribute rule

Returns:

  • (Object)

    the current value of rule



5
6
7
# File 'lib/dry/validation/error_compiler/input.rb', line 5

def rule
  @rule
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



5
6
7
# File 'lib/dry/validation/error_compiler/input.rb', line 5

def text
  @text
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/dry/validation/error_compiler/input.rb', line 14

def eql?(other)
  other.is_a?(String) ? text == other : super
end

#signatureObject



10
11
12
# File 'lib/dry/validation/error_compiler/input.rb', line 10

def signature
  @signature ||= [rule, predicate].hash
end

#to_sObject



6
7
8
# File 'lib/dry/validation/error_compiler/input.rb', line 6

def to_s
  text
end