Class: Dependabot::Nuget::DirectoryPackagesPropsDiscovery

Inherits:
DependencyFileDiscovery show all
Extended by:
T::Sig
Defined in:
lib/dependabot/nuget/discovery/directory_packages_props_discovery.rb

Instance Attribute Summary collapse

Attributes inherited from DependencyFileDiscovery

#dependencies, #file_path

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DependencyFileDiscovery

#dependency_set

Constructor Details

#initialize(file_path:, is_transitive_pinning_enabled:, dependencies:) ⇒ DirectoryPackagesPropsDiscovery

Returns a new instance of DirectoryPackagesPropsDiscovery.



34
35
36
37
# File 'lib/dependabot/nuget/discovery/directory_packages_props_discovery.rb', line 34

def initialize(file_path:, is_transitive_pinning_enabled:, dependencies:)
  super(file_path: file_path, dependencies: dependencies)
  @is_transitive_pinning_enabled = is_transitive_pinning_enabled
end

Instance Attribute Details

#is_transitive_pinning_enabledObject (readonly)

Returns the value of attribute is_transitive_pinning_enabled.



40
41
42
# File 'lib/dependabot/nuget/discovery/directory_packages_props_discovery.rb', line 40

def is_transitive_pinning_enabled
  @is_transitive_pinning_enabled
end

Class Method Details

.from_json(json) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dependabot/nuget/discovery/directory_packages_props_discovery.rb', line 15

def self.from_json(json)
  return nil if json.nil?

  file_path = T.let(json.fetch("FilePath"), String)
  is_transitive_pinning_enabled = T.let(json.fetch("IsTransitivePinningEnabled"), T::Boolean)
  dependencies = T.let(json.fetch("Dependencies"), T::Array[T::Hash[String, T.untyped]]).map do |dep|
    DependencyDetails.from_json(dep)
  end

  DirectoryPackagesPropsDiscovery.new(file_path: file_path,
                                      is_transitive_pinning_enabled: is_transitive_pinning_enabled,
                                      dependencies: dependencies)
end