Class: Verifier::Scope Private

Inherits:
Object
  • Object
show all
Defined in:
lib/verifier/scope.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.

Provides the scope for I18n translations of verification errors

Instance Method Summary collapse

Constructor Details

#initialize(object, method) ⇒ undefined

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.

Initializes a new instance

Parameters:

  • object (Object)

    the object whose method should be verified

  • method (Symbol)

    the name of the method to be verified



19
20
21
# File 'lib/verifier/scope.rb', line 19

def initialize(object, method)
  @object, @method = object, method
end

Instance Method Details

#fullArray<Symbol>

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.

Returns a scope for translations of #method verification errors

Returns:

  • (Array<Symbol>)


33
34
35
# File 'lib/verifier/scope.rb', line 33

def full
  @full ||= short + [method.to_sym]
end

#shortArray<Symbol>

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.

Returns a scope for all translations of #object verification errors

Returns:

  • (Array<Symbol>)


26
27
28
# File 'lib/verifier/scope.rb', line 26

def short
  @short ||= [:verifier, name, type]
end

#tag<String>

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.

Returns a tag (# or .) for the method

Returns:

  • (<String>)


40
41
42
# File 'lib/verifier/scope.rb', line 40

def tag
  (type == :class) ? "." : "#"
end