class Object

Object extention

Attributes

memo[RW]

Couldn't work for Fixnum (Marshal)

Public Instance Methods

output(format = :yaml) click to toggle source
# File lib/bio/shell/object.rb, line 22
def output(format = :yaml)
  case format
  when :yaml
    self.to_yaml
  when :html
    format_html
  when :inspect
    format_pp
  when :png
    # *TODO*
  when :svg
    # *TODO*
  when :graph
    # *TODO* (Gruff, RSRuby etc.)
  else
    #self.inspect.to_s.fold(80)
    self.to_s
  end
end

Private Instance Methods

format_html() click to toggle source
# File lib/bio/shell/object.rb, line 44
def format_html
  "<pre>#{CGI.escapeHTML(format_pp)}</pre>"
end
format_pp() click to toggle source
# File lib/bio/shell/object.rb, line 48
def format_pp
  str = ""
  PP.pp(self, str)
  return str
end