Class: Eco::API::Common::Loaders::Base
- Extended by:
- Language::Klass::HelpersBuilt
- Includes:
- Language::AuxiliarLogger
- Defined in:
- lib/eco/api/common/loaders/base.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Language::AuxiliarLogger
Class Method Summary collapse
-
.<=>(other) ⇒ Object
Sort order.
-
.created_at ⇒ Object
Class creation timestamp, to be able to load them in the order they were declared.
-
.set_created_at! ⇒ Object
If still not set, it sets the
created_atclass timestamp.
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
This method will be called when the BaseLoader is created.
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
#initialize ⇒ Base
Note:
- this method should implement the loading logics for the given
Childrenclass.
This method will be called when the BaseLoader is created
29 30 31 |
# File 'lib/eco/api/common/loaders/base.rb', line 29 def initialize raise 'You should implement this method' end |
Class Method Details
.<=>(other) ⇒ Object
Sort order
11 12 13 |
# File 'lib/eco/api/common/loaders/base.rb', line 11 def <=>(other) created_at <=> other.created_at end |
.created_at ⇒ Object
Class creation timestamp, to be able to load them in the order they were declared.
21 22 23 |
# File 'lib/eco/api/common/loaders/base.rb', line 21 def created_at @created_at ||= Time.now end |
.set_created_at! ⇒ Object
If still not set, it sets the created_at class timestamp.
16 17 18 |
# File 'lib/eco/api/common/loaders/base.rb', line 16 def set_created_at! @created_at ||= Time.now unless @created_at # rubocop:disable Naming/MemoizedInstanceVariableName end |