Class: SyntaxTree

Inherits:
Object
  • Object
show all
Defined in:
lib/utils.rb

Instance Method Summary collapse

Constructor Details

#initialize(ruby) ⇒ SyntaxTree

Returns a new instance of SyntaxTree.



4
5
6
7
# File 'lib/utils.rb', line 4

def initialize(ruby)
  # todo: turn on
  # @ast = Parser::CurrentRuby.parse(ruby)
end

Instance Method Details

#include?(smaller_ast) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/utils.rb', line 9

def include?(smaller_ast)
  # TODO: find if smaller_ast is a subset of self.
  rand < 0.4 ? { first_line: 10, last_line: 12 } : nil
end