Class: Dependabot::Nuget::NativeDependencyDetails

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/nuget/native_discovery/native_dependency_details.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, version:, type:, evaluation:, target_frameworks:, is_dev_dependency:, is_direct:, is_transitive:, is_override:, is_update:, info_url:) ⇒ NativeDependencyDetails

Returns a new instance of NativeDependencyDetails.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 53

def initialize(name:, version:, type:, evaluation:, target_frameworks:, is_dev_dependency:, is_direct:,
               is_transitive:, is_override:, is_update:, info_url:)
  @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
  @info_url = info_url
end

Instance Attribute Details

#evaluationObject (readonly)

Returns the value of attribute evaluation.



78
79
80
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 78

def evaluation
  @evaluation
end

#info_urlObject (readonly)

Returns the value of attribute info_url.



99
100
101
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 99

def info_url
  @info_url
end

#is_dev_dependencyObject (readonly)

Returns the value of attribute is_dev_dependency.



84
85
86
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 84

def is_dev_dependency
  @is_dev_dependency
end

#is_directObject (readonly)

Returns the value of attribute is_direct.



87
88
89
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 87

def is_direct
  @is_direct
end

#is_overrideObject (readonly)

Returns the value of attribute is_override.



93
94
95
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 93

def is_override
  @is_override
end

#is_transitiveObject (readonly)

Returns the value of attribute is_transitive.



90
91
92
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 90

def is_transitive
  @is_transitive
end

#is_updateObject (readonly)

Returns the value of attribute is_update.



96
97
98
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 96

def is_update
  @is_update
end

#nameObject (readonly)

Returns the value of attribute name.



69
70
71
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 69

def name
  @name
end

#target_frameworksObject (readonly)

Returns the value of attribute target_frameworks.



81
82
83
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 81

def target_frameworks
  @target_frameworks
end

#typeObject (readonly)

Returns the value of attribute type.



75
76
77
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 75

def type
  @type
end

#versionObject (readonly)

Returns the value of attribute version.



72
73
74
# File 'lib/dependabot/nuget/native_discovery/native_dependency_details.rb', line 72

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
37
38
# File 'lib/dependabot/nuget/native_discovery/native_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 = NativeEvaluationDetails
               .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)
  info_url = T.let(json.fetch("InfoUrl"), T.nilable(String))

  NativeDependencyDetails.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,
                              info_url: info_url)
end