Class: Redstruct::Factory::Object

Inherits:
Object
  • Object
show all
Includes:
Utils::Inspectable
Defined in:
lib/redstruct/factory/object.rb

Overview

Base class for all objects a factory can produce

Direct Known Subclasses

Lock, SortedSet::Slice, Struct

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::Inspectable

#inspect

Constructor Details

#initialize(factory:) ⇒ Object

Returns a new instance of Object.

Parameters:



15
16
17
# File 'lib/redstruct/factory/object.rb', line 15

def initialize(factory:)
  @factory = factory
end

Instance Attribute Details

#factoryRedstruct::Factory (readonly)

Returns factory which was used to create the object.

Returns:



12
13
14
# File 'lib/redstruct/factory/object.rb', line 12

def factory
  @factory
end

Instance Method Details

#connectionRedstruct::ConnectionProxy

Convenience accessor for the factory’s connection



21
22
23
# File 'lib/redstruct/factory/object.rb', line 21

def connection
  return @factory.connection
end

#inspectable_attributesObject

# @!visibility private



26
27
28
# File 'lib/redstruct/factory/object.rb', line 26

def inspectable_attributes
  { factory: @factory }
end