Class: Eco::API::Common::Loaders::Base
- Extended by:
- ClassHelpers
- 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_at
class timestamp.
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
This method will be called when the BaseLoader is created.
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
#initialize ⇒ Base
Note:
- this method should implement the loading logics for the given
Children
class.
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 |