Class: Eco::API::Common::Loaders::Base

Inherits:
Object
  • Object
show all
Extended by:
Language::Klass::HelpersBuilt
Includes:
Language::AuxiliarLogger
Defined in:
lib/eco/api/common/loaders/base.rb

Direct Known Subclasses

CaseBase

Instance Attribute Summary

Attributes included from Language::AuxiliarLogger

#logger

Class Method Summary collapse

Instance Method Summary collapse

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

#descendants, #descendants?

Methods included from Language::Klass::Builder

#new_class

Methods included from Language::Klass::Uid

#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

#log

Constructor Details

#initializeBase

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_atObject

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