Class: SleepingKingStudios::Tools::Base
- Inherits:
-
Object
- Object
- SleepingKingStudios::Tools::Base
- Extended by:
- Forwardable
- Defined in:
- lib/sleeping_king_studios/tools/base.rb
Overview
Abstract base class for Tools classes.
Direct Known Subclasses
ArrayTools, Assertions, CoreTools, HashTools, IntegerTools, Messages, ObjectTools, StringTools
Class Method Summary collapse
-
.instance ⇒ SleepingKingStudios::Tools::Base
deprecated
Deprecated.
v1.3.0 Use Toolbelt.instance instead.
Instance Method Summary collapse
-
#initialize(toolbelt: nil) ⇒ Base
constructor
A new instance of Base.
-
#toolbelt ⇒ SleepingKingStudios::Tools::Toolbelt
(also: #tools)
The toolbelt this tools instance belongs to, or the global toolbelt singleton.
Constructor Details
#initialize(toolbelt: nil) ⇒ Base
Returns a new instance of Base.
32 33 34 |
# File 'lib/sleeping_king_studios/tools/base.rb', line 32 def initialize(toolbelt: nil) @toolbelt = toolbelt end |
Class Method Details
.instance ⇒ SleepingKingStudios::Tools::Base
Deprecated.
v1.3.0 Use Toolbelt.instance instead.
Returns a memoized instance of the tools class.
21 22 23 24 25 26 27 28 |
# File 'lib/sleeping_king_studios/tools/base.rb', line 21 def self.instance SleepingKingStudios::Tools::Toolbelt.instance.core_tools.deprecate( "#{name}.instance", message: 'Use Toolbelt.instance instead.' ) @instance ||= new end |
Instance Method Details
#toolbelt ⇒ SleepingKingStudios::Tools::Toolbelt Also known as: tools
Returns the toolbelt this tools instance belongs to, or the global toolbelt singleton.
38 39 40 |
# File 'lib/sleeping_king_studios/tools/base.rb', line 38 def toolbelt @toolbelt ||= SleepingKingStudios::Tools::Toolbelt.global end |