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.
Instance Method Summary collapse
Methods inherited from Base
<=>, created_at, #initialize, set_created_at!
Methods included from ClassHelpers
#class_resolver, #descendants, #descendants?, #inheritable_attrs, #inheritable_class_vars, #inherited, #instance_variable_name, #new_class, #resolve_class, #to_constant
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.
10 11 12 13 14 15 |
# File 'lib/eco/api/common/loaders/case_base.rb', line 10 def name(value = nil) name_only_once! if value set_created_at! return @name ||= to_s 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
18 19 20 |
# File 'lib/eco/api/common/loaders/case_base.rb', line 18 def name_only_once! raise "You have already declared #{self} or you are trying to give it a name twice" if @name end |
Instance Method Details
#name ⇒ Object
23 24 25 |
# File 'lib/eco/api/common/loaders/case_base.rb', line 23 def name self.class.name end |