Class: SleepingKingStudios::Tools::Toolbelt
- Inherits:
- BasicObject
- Defined in:
- lib/sleeping_king_studios/tools/toolbelt.rb
Overview
Helper object for quick access to all available tools.
Instance Attribute Summary collapse
-
#array_tools ⇒ Object
(also: #ary)
readonly
Returns the value of attribute array_tools.
-
#assertions ⇒ Object
readonly
Returns the value of attribute assertions.
-
#core_tools ⇒ Object
readonly
Returns the value of attribute core_tools.
-
#hash_tools ⇒ Object
(also: #hsh)
readonly
Returns the value of attribute hash_tools.
-
#integer_tools ⇒ Object
(also: #int)
readonly
Returns the value of attribute integer_tools.
-
#object_tools ⇒ Object
(also: #obj)
readonly
Returns the value of attribute object_tools.
-
#string_tools ⇒ Object
(also: #str)
readonly
Returns the value of attribute string_tools.
Class Method Summary collapse
-
.instance ⇒ SleepingKingStudios::Tools::Toolbelt
A memoized instance of the toolbelt class.
Instance Method Summary collapse
-
#initialize(deprecation_strategy: nil, inflector: nil) ⇒ Toolbelt
constructor
A new instance of Toolbelt.
-
#inspect ⇒ String
(also: #to_s)
A human-readable representation of the object.
Constructor Details
#initialize(deprecation_strategy: nil, inflector: nil) ⇒ Toolbelt
Returns a new instance of Toolbelt.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sleeping_king_studios/tools/toolbelt.rb', line 19 def initialize(deprecation_strategy: nil, inflector: nil) @array_tools = ::SleepingKingStudios::Tools::ArrayTools.new @assertions = ::SleepingKingStudios::Tools::Assertions.new @core_tools = ::SleepingKingStudios::Tools::CoreTools.new( deprecation_strategy: deprecation_strategy ) @hash_tools = ::SleepingKingStudios::Tools::HashTools.new @integer_tools = ::SleepingKingStudios::Tools::IntegerTools.new @object_tools = ::SleepingKingStudios::Tools::ObjectTools.new @string_tools = ::SleepingKingStudios::Tools::StringTools.new(inflector: inflector) end |
Instance Attribute Details
#array_tools ⇒ Object (readonly) Also known as: ary
Returns the value of attribute array_tools.
32 33 34 |
# File 'lib/sleeping_king_studios/tools/toolbelt.rb', line 32 def array_tools @array_tools end |
#assertions ⇒ Object (readonly)
Returns the value of attribute assertions.
34 35 36 |
# File 'lib/sleeping_king_studios/tools/toolbelt.rb', line 34 def assertions @assertions end |
#core_tools ⇒ Object (readonly)
Returns the value of attribute core_tools.
36 37 38 |
# File 'lib/sleeping_king_studios/tools/toolbelt.rb', line 36 def core_tools @core_tools end |
#hash_tools ⇒ Object (readonly) Also known as: hsh
Returns the value of attribute hash_tools.
38 39 40 |
# File 'lib/sleeping_king_studios/tools/toolbelt.rb', line 38 def hash_tools @hash_tools end |
#integer_tools ⇒ Object (readonly) Also known as: int
Returns the value of attribute integer_tools.
40 41 42 |
# File 'lib/sleeping_king_studios/tools/toolbelt.rb', line 40 def integer_tools @integer_tools end |
#object_tools ⇒ Object (readonly) Also known as: obj
Returns the value of attribute object_tools.
42 43 44 |
# File 'lib/sleeping_king_studios/tools/toolbelt.rb', line 42 def object_tools @object_tools end |
#string_tools ⇒ Object (readonly) Also known as: str
Returns the value of attribute string_tools.
44 45 46 |
# File 'lib/sleeping_king_studios/tools/toolbelt.rb', line 44 def string_tools @string_tools end |
Class Method Details
.instance ⇒ SleepingKingStudios::Tools::Toolbelt
Returns a memoized instance of the toolbelt class.
10 11 12 |
# File 'lib/sleeping_king_studios/tools/toolbelt.rb', line 10 def self.instance @instance ||= new end |
Instance Method Details
#inspect ⇒ String Also known as: to_s
Returns a human-readable representation of the object.
53 54 55 |
# File 'lib/sleeping_king_studios/tools/toolbelt.rb', line 53 def inspect "#<#{::Object.instance_method(:class).bind(self).call.name}>" end |