Module: Andromeda::Impl::To_S

Included in:
Atom::Region, Guides::Guide, Guides::Track, Atom, ProtoPlan, XorId, Spot
Defined in:
lib/andromeda/impl/to_s.rb,
lib/andromeda/impl_base.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.short_s(v = value) ⇒ Object



20
21
22
23
24
25
# 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

Instance Method Details

#to_s(short = false) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# 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_sObject



18
# File 'lib/andromeda/impl/to_s.rb', line 18

def to_short_s ; '' end