Class: Dependabot::Nuget::DependencyDetails
- Inherits:
-
Object
- Object
- Dependabot::Nuget::DependencyDetails
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/nuget/discovery/dependency_details.rb
Instance Attribute Summary collapse
-
#evaluation ⇒ Object
readonly
Returns the value of attribute evaluation.
-
#is_dev_dependency ⇒ Object
readonly
Returns the value of attribute is_dev_dependency.
-
#is_direct ⇒ Object
readonly
Returns the value of attribute is_direct.
-
#is_override ⇒ Object
readonly
Returns the value of attribute is_override.
-
#is_transitive ⇒ Object
readonly
Returns the value of attribute is_transitive.
-
#is_update ⇒ Object
readonly
Returns the value of attribute is_update.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#target_frameworks ⇒ Object
readonly
Returns the value of attribute target_frameworks.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, version:, type:, evaluation:, target_frameworks:, is_dev_dependency:, is_direct:, is_transitive:, is_override:, is_update:) ⇒ DependencyDetails
constructor
A new instance of DependencyDetails.
Constructor Details
#initialize(name:, version:, type:, evaluation:, target_frameworks:, is_dev_dependency:, is_direct:, is_transitive:, is_override:, is_update:) ⇒ DependencyDetails
Returns a new instance of DependencyDetails.
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 50 def initialize(name:, version:, type:, evaluation:, target_frameworks:, is_dev_dependency:, is_direct:, is_transitive:, is_override:, is_update:) @name = name @version = version @type = type @evaluation = evaluation @target_frameworks = target_frameworks @is_dev_dependency = is_dev_dependency @is_direct = is_direct @is_transitive = is_transitive @is_override = is_override @is_update = is_update end |
Instance Attribute Details
#evaluation ⇒ Object (readonly)
Returns the value of attribute evaluation.
74 75 76 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 74 def evaluation @evaluation end |
#is_dev_dependency ⇒ Object (readonly)
Returns the value of attribute is_dev_dependency.
80 81 82 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 80 def is_dev_dependency @is_dev_dependency end |
#is_direct ⇒ Object (readonly)
Returns the value of attribute is_direct.
83 84 85 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 83 def is_direct @is_direct end |
#is_override ⇒ Object (readonly)
Returns the value of attribute is_override.
89 90 91 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 89 def is_override @is_override end |
#is_transitive ⇒ Object (readonly)
Returns the value of attribute is_transitive.
86 87 88 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 86 def is_transitive @is_transitive end |
#is_update ⇒ Object (readonly)
Returns the value of attribute is_update.
92 93 94 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 92 def is_update @is_update end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
65 66 67 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 65 def name @name end |
#target_frameworks ⇒ Object (readonly)
Returns the value of attribute target_frameworks.
77 78 79 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 77 def target_frameworks @target_frameworks end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
71 72 73 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 71 def type @type end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
68 69 70 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 68 def version @version end |
Class Method Details
.from_json(json) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dependabot/nuget/discovery/dependency_details.rb', line 13 def self.from_json(json) name = T.let(json.fetch("Name"), String) version = T.let(json.fetch("Version"), T.nilable(String)) type = T.let(json.fetch("Type"), String) evaluation = EvaluationDetails .from_json(T.let(json.fetch("EvaluationResult"), T.nilable(T::Hash[String, T.untyped]))) target_frameworks = T.let(json.fetch("TargetFrameworks"), T.nilable(T::Array[String])) is_dev_dependency = T.let(json.fetch("IsDevDependency"), T::Boolean) is_direct = T.let(json.fetch("IsDirect"), T::Boolean) is_transitive = T.let(json.fetch("IsTransitive"), T::Boolean) is_override = T.let(json.fetch("IsOverride"), T::Boolean) is_update = T.let(json.fetch("IsUpdate"), T::Boolean) DependencyDetails.new(name: name, version: version, type: type, evaluation: evaluation, target_frameworks: target_frameworks, is_dev_dependency: is_dev_dependency, is_direct: is_direct, is_transitive: is_transitive, is_override: is_override, is_update: is_update) end |