Module: Redstruct::Utils::Inspectable

Included in:
Factory, Types::Base, Types::Struct
Defined in:
lib/redstruct/utils/inspectable.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject



4
5
6
7
8
9
10
# File 'lib/redstruct/utils/inspectable.rb', line 4

def inspect
  attributes = inspectable_attributes.map do |key, value|
    "#{key}: <#{value.inspect}>"
  end

  return "#{self.class.name}: #{attributes.join(', ')}"
end

#inspectable_attributesObject



12
13
14
# File 'lib/redstruct/utils/inspectable.rb', line 12

def inspectable_attributes
  {}
end

#to_sObject



16
17
18
# File 'lib/redstruct/utils/inspectable.rb', line 16

def to_s
  return inspect
end