Class: Verifier::Scope Private
- Inherits:
-
Object
- Object
- Verifier::Scope
- 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
-
#full ⇒ Array<Symbol>
private
Returns a scope for translations of #method verification errors.
-
#initialize(object, method) ⇒ undefined
constructor
private
Initializes a new instance.
-
#short ⇒ Array<Symbol>
private
Returns a scope for all translations of #object verification errors.
-
#tag ⇒ <String>
private
Returns a tag (# or .) for the method.
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
19 20 21 |
# File 'lib/verifier/scope.rb', line 19 def initialize(object, method) @object, @method = object, method end |
Instance Method Details
#full ⇒ Array<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
33 34 35 |
# File 'lib/verifier/scope.rb', line 33 def full @full ||= short + [method.to_sym] end |
#short ⇒ Array<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
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
40 41 42 |
# File 'lib/verifier/scope.rb', line 40 def tag (type == :class) ? "." : "#" end |