Class: Yoda::Store::Actions::ReadFile
- Inherits:
-
Object
- Object
- Yoda::Store::Actions::ReadFile
- Defined in:
- lib/yoda/store/actions/read_file.rb
Instance Attribute Summary collapse
- #file ⇒ String readonly
- #registry ⇒ Registry readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(registry, file, root_path: nil) ⇒ ReadFile
constructor
A new instance of ReadFile.
- #run ⇒ void
Constructor Details
#initialize(registry, file, root_path: nil) ⇒ ReadFile
Returns a new instance of ReadFile.
20 21 22 23 24 |
# File 'lib/yoda/store/actions/read_file.rb', line 20 def initialize(registry, file, root_path: nil) @registry = registry @file = file @root_path = root_path end |
Instance Attribute Details
#file ⇒ String (readonly)
9 10 11 |
# File 'lib/yoda/store/actions/read_file.rb', line 9 def file @file end |
#registry ⇒ Registry (readonly)
6 7 8 |
# File 'lib/yoda/store/actions/read_file.rb', line 6 def registry @registry end |
Class Method Details
.run(registry, file, root_path: nil) ⇒ void
This method returns an undefined value.
14 15 16 |
# File 'lib/yoda/store/actions/read_file.rb', line 14 def self.run(registry, file, root_path: nil) self.new(registry, file, root_path: root_path).run end |
Instance Method Details
#run ⇒ void
This method returns an undefined value.
27 28 29 30 31 32 |
# File 'lib/yoda/store/actions/read_file.rb', line 27 def run YARD::Registry.clear YARD.parse([file]) patch = YardImporter.new(file).import(YARD::Registry.all + [YARD::Registry.root]).patch registry.add_patch(patch) end |