class Zapata::Analyst

Attributes

result[R]

Public Class Methods

analyze(filename) click to toggle source
# File lib/zapata/analyst.rb, line 7
def self.analyze(filename)
  code = Core::Reader.parse(filename)
  analyst = Analyst.new(code)
  result = analyst.result.dup
  analyst.clean
  result
end
new(code) click to toggle source
# File lib/zapata/analyst.rb, line 15
def initialize(code)
  # class dive
  Diver.search_for(:klass)
  Diver.dive(code)
  # var dive
  Diver.search_for(:var)
  Diver.dive(code)
  # def dive
  Diver.search_for(:def)
  Diver.dive(code)
  # send dive
  Diver.search_for(:send)
  Diver.dive(code)

  @result = DB.all
end

Public Instance Methods

clean() click to toggle source
# File lib/zapata/analyst.rb, line 32
def clean
  DB.destroy_all
end