Class: Yoda::Cli::AnalyzeDeps::Builder
- Inherits:
-
Object
- Object
- Yoda::Cli::AnalyzeDeps::Builder
- Defined in:
- lib/yoda/cli/analyze_deps.rb
Instance Attribute Summary collapse
- #root_path ⇒ String readonly
Instance Method Summary collapse
- #gems ⇒ Array<Yoda::Store::Objects::Library::Gem>
-
#initialize(root_path) ⇒ Builder
constructor
A new instance of Builder.
- #to_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(root_path) ⇒ Builder
Returns a new instance of Builder.
18 19 20 |
# File 'lib/yoda/cli/analyze_deps.rb', line 18 def initialize(root_path) @root_path = root_path end |
Instance Attribute Details
#root_path ⇒ String (readonly)
15 16 17 |
# File 'lib/yoda/cli/analyze_deps.rb', line 15 def root_path @root_path end |
Instance Method Details
#gems ⇒ Array<Yoda::Store::Objects::Library::Gem>
23 24 25 |
# File 'lib/yoda/cli/analyze_deps.rb', line 23 def gems @gems ||= dependency_specs.map { |spec| Yoda::Store::Objects::Library::Gem.from_gem_spec(spec) } end |
#to_h ⇒ Object
27 28 29 30 31 32 |
# File 'lib/yoda/cli/analyze_deps.rb', line 27 def to_h { path: root_path, dependencies: gems.map(&:to_h), } end |
#to_json ⇒ Object
34 35 36 |
# File 'lib/yoda/cli/analyze_deps.rb', line 34 def to_json(*) to_h.to_json end |