Module: Kernel

Defined in:
lib/shoes/inspect.rb

Instance Method Summary collapse

Instance Method Details

#inspect(hits = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/shoes/inspect.rb', line 2

def inspect(hits = {})
  return "(#{self.class} ...)" if hits[self]
  hits[self] = true
  if instance_variables.empty?
      "(#{self.class})"
  else
      "(#{self.class} " + 
          instance_variables.map do |x|
              v = instance_variable_get(x)
              "#{x}=" + (v.method(:inspect).arity == 0 ? v.inspect : v.inspect(hits))
          end.join(' ') +
      ")"
  end
end

#to_sObject

def to_html obj = self

Web.Bit {
  h1 "A #{obj.class}"
}

end



22
# File 'lib/shoes/inspect.rb', line 22

def to_s; inspect end