class Object

Object extention

Attributes

memo[RW]

Couldn't work for Fixnum (Marshal)

Public Instance Methods

initialize_single_source(root) click to toggle source
# File lib/bio/pathway.rb, line 693
def initialize_single_source(root)
  inf = 1 / 0.0                               # inf.infinite? -> true

  distance = {}
  predecessor = {}

  @graph.each_key do |k|
    distance[k] = inf
    predecessor[k] = nil
  end
  distance[root] = 0
  return distance, predecessor
end
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