Class: Hanami::V1::Validations::Namespace Private
- Inherits:
-
Object
- Object
- Hanami::V1::Validations::Namespace
- Defined in:
- lib/hanami/v1/validations/namespace.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.
Validations message namespace.
For a given ‘FooValidator` class, it will look for I18n messages within the `foo` group.
Constant Summary collapse
- SUFFIX =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"Validator"
- SUFFIX_REPLACEMENT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
""
- RUBY_NAMESPACE_SEPARATOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"/"
- RUBY_NAMESPACE_REPLACEMENT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"."
Class Method Summary collapse
- .new(name, klass) ⇒ Object private
Instance Method Summary collapse
-
#initialize(name) ⇒ Namespace
constructor
private
A new instance of Namespace.
- #to_s ⇒ Object private
Constructor Details
#initialize(name) ⇒ Namespace
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 new instance of Namespace.
43 44 45 |
# File 'lib/hanami/v1/validations/namespace.rb', line 43 def initialize(name) @name = name end |
Class Method Details
.new(name, klass) ⇒ 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.
34 35 36 37 38 39 |
# File 'lib/hanami/v1/validations/namespace.rb', line 34 def self.new(name, klass) result = name || klass.name return nil if result.nil? super(result) end |
Instance Method Details
#to_s ⇒ 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.
49 50 51 |
# File 'lib/hanami/v1/validations/namespace.rb', line 49 def to_s underscored_name.gsub(RUBY_NAMESPACE_SEPARATOR, RUBY_NAMESPACE_REPLACEMENT) end |