module Andromeda::Impl::To_S

Public Class Methods

short_s(v = value) click to toggle source
# File lib/andromeda/impl/to_s.rb, line 20
def self.short_s(v = value)
  return ":#{v}" if v.is_a?(Symbol)
  return "'#{v}'" if v.is_a?(String)
  return 'nil' unless v
  "#{v}"
end

Public Instance Methods

to_s(short = false) click to toggle source
Calls superclass method
# File lib/andromeda/impl/to_s.rb, line 7
def to_s(short = false)
  if short
    to_short_s
  else
    super_str  = super()
    class_name = self.class.name.split('::')[-1]
    obj_id     = object_id.to_s(16)
    "\#<#{class_name}:0x#{obj_id}#{to_s(true)}>"
  end
end
to_short_s() click to toggle source
# File lib/andromeda/impl/to_s.rb, line 18
def to_short_s ; '' end