Class: Dependabot::Nuget::NativeDirectoryPackagesPropsDiscovery
- Inherits:
-
NativeDependencyFileDiscovery
- Object
- NativeDependencyFileDiscovery
- Dependabot::Nuget::NativeDirectoryPackagesPropsDiscovery
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/nuget/native_discovery/native_directory_packages_props_discovery.rb
Instance Attribute Summary collapse
-
#is_transitive_pinning_enabled ⇒ Object
readonly
Returns the value of attribute is_transitive_pinning_enabled.
Attributes inherited from NativeDependencyFileDiscovery
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file_path:, is_transitive_pinning_enabled:, dependencies:) ⇒ NativeDirectoryPackagesPropsDiscovery
constructor
A new instance of NativeDirectoryPackagesPropsDiscovery.
Methods inherited from NativeDependencyFileDiscovery
Constructor Details
#initialize(file_path:, is_transitive_pinning_enabled:, dependencies:) ⇒ NativeDirectoryPackagesPropsDiscovery
Returns a new instance of NativeDirectoryPackagesPropsDiscovery.
35 36 37 38 |
# File 'lib/dependabot/nuget/native_discovery/native_directory_packages_props_discovery.rb', line 35 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_enabled ⇒ Object (readonly)
Returns the value of attribute is_transitive_pinning_enabled.
41 42 43 |
# File 'lib/dependabot/nuget/native_discovery/native_directory_packages_props_discovery.rb', line 41 def is_transitive_pinning_enabled @is_transitive_pinning_enabled end |
Class Method Details
.from_json(json, directory) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/dependabot/nuget/native_discovery/native_directory_packages_props_discovery.rb', line 16 def self.from_json(json, directory) return nil if json.nil? file_path = File.join(directory, 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| NativeDependencyDetails.from_json(dep) end NativeDirectoryPackagesPropsDiscovery.new(file_path: file_path, is_transitive_pinning_enabled: is_transitive_pinning_enabled, dependencies: dependencies) end |