Class: Eco::API::Common::Loaders::CaseBase
- Defined in:
- lib/eco/api/common/loaders/case_base.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.name(value = nil) ⇒ Object
The name that this case, policy or error handler will have.
-
.type ⇒ Object
writeonly
Sets the attribute type.
Attributes included from Language::AuxiliarLogger
Class Method Summary collapse
-
.name_only_once! ⇒ Object
Prevent the same class to be re-opened/re-named.
- .original_name ⇒ Object
Instance Method Summary collapse
-
#name ⇒ Object
Instance Methods.
Methods inherited from Base
<=>, created_at, #initialize, set_created_at!
Methods included from Language::Klass::InheritableClassVars
#inheritable_attrs, #inheritable_class_vars, #inherited
Methods included from Language::Klass::Naming
#instance_variable_name, #to_constant
Methods included from Language::Klass::Hierarchy
Methods included from Language::Klass::Builder
Methods included from Language::Klass::Uid
Methods included from Language::Klass::Resolver
#class_resolver, #resolve_class
Methods included from Language::Klass::Const
#if_const, #redef_without_warning
Methods included from Language::AuxiliarLogger
Constructor Details
This class inherits a constructor from Eco::API::Common::Loaders::Base
Class Attribute Details
.name(value = nil) ⇒ Object
The name that this case, policy or error handler will have.
12 13 14 15 16 17 18 19 |
# File 'lib/eco/api/common/loaders/case_base.rb', line 12 def name(value = nil) name_only_once! if value set_created_at! unless @name return original_name unless @name || value return @name unless value @name = value end |
.type=(value) ⇒ Object (writeonly)
Sets the attribute type
7 8 9 |
# File 'lib/eco/api/common/loaders/case_base.rb', line 7 def type=(value) @type = value end |
Class Method Details
.name_only_once! ⇒ Object
Prevent the same class to be re-opened/re-named
22 23 24 25 26 27 28 |
# File 'lib/eco/api/common/loaders/case_base.rb', line 22 def name_only_once! return unless @name msg = "You have already declared #{self} " msg << 'or you are trying to give it a name twice' raise msg if @name end |
.original_name ⇒ Object
9 |
# File 'lib/eco/api/common/loaders/case_base.rb', line 9 alias_method :original_name, :name |
Instance Method Details
#name ⇒ Object
Instance Methods
33 34 35 |
# File 'lib/eco/api/common/loaders/case_base.rb', line 33 def name self.class.name end |