Class: ImportGraph::Scanner
- Inherits:
-
Object
- Object
- ImportGraph::Scanner
- Defined in:
- lib/import_graph/scanner.rb
Overview
Scanner class is the starting interface though which you interact with the gem.
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
Instance Method Summary collapse
- #generate_graph ⇒ Object
- #get_dependees_from_file(file_path) ⇒ Object
- #get_dependents_from_file(file_path) ⇒ Object
-
#initialize(dir_path, config) ⇒ Scanner
constructor
A new instance of Scanner.
Constructor Details
#initialize(dir_path, config) ⇒ Scanner
Returns a new instance of Scanner.
11 12 13 14 15 |
# File 'lib/import_graph/scanner.rb', line 11 def initialize(dir_path, config) @dir_path = dir_path @graph = nil @config = config end |
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
7 8 9 |
# File 'lib/import_graph/scanner.rb', line 7 def graph @graph end |
Instance Method Details
#generate_graph ⇒ Object
17 18 19 20 |
# File 'lib/import_graph/scanner.rb', line 17 def generate_graph main_parser = Parser::Main.new(@dir_path, @config) @graph = main_parser.parse end |
#get_dependees_from_file(file_path) ⇒ Object
26 27 28 |
# File 'lib/import_graph/scanner.rb', line 26 def get_dependees_from_file(file_path) @graph.get_dependee_files(file_path) end |
#get_dependents_from_file(file_path) ⇒ Object
22 23 24 |
# File 'lib/import_graph/scanner.rb', line 22 def get_dependents_from_file(file_path) @graph.get_dependent_files(file_path) end |