Class: Attestor::Validations::Message Private

Inherits:
String
  • Object
show all
Defined in:
lib/attestor/validations/message.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Bulder for error messages

Class Method Summary collapse

Class Method Details

.initialize(value, object, options = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
28
29
30
31
# File 'lib/attestor/validations/message.rb', line 25

def initialize(value, object, options = {})
  @value   = value
  @object  = object
  @options = options
  super(@value.instance_of?(Symbol) ? translation : @value.to_s)
  freeze
end

.new(value, object, options = {}) ⇒ String

Builds a string from value

Parameters:

  • value (#to_s)
  • object (Object)
  • options (Hash) (defaults to: {})

    options for translating symbolic value

Returns:

  • (String)

    either translation of symbolic value or stringified value argument



# File 'lib/attestor/validations/message.rb', line 12