Class: DependencySpy::Dependency
- Inherits:
-
Struct
- Object
- Struct
- DependencySpy::Dependency
- Defined in:
- lib/dependency_spy/dtos/dependency.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
-
#version ⇒ Object
Returns the value of attribute version.
-
#vulnerabilities ⇒ Object
Returns the value of attribute vulnerabilities.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
52 53 54 |
# File 'lib/dependency_spy/dtos/dependency.rb', line 52 def name @name end |
#type ⇒ Object
Returns the value of attribute type
52 53 54 |
# File 'lib/dependency_spy/dtos/dependency.rb', line 52 def type @type end |
#version ⇒ Object
Returns the value of attribute version
52 53 54 |
# File 'lib/dependency_spy/dtos/dependency.rb', line 52 def version @version end |
#vulnerabilities ⇒ Object
Returns the value of attribute vulnerabilities
52 53 54 |
# File 'lib/dependency_spy/dtos/dependency.rb', line 52 def vulnerabilities @vulnerabilities end |
Instance Method Details
#to_json(*args) ⇒ Object
75 76 77 |
# File 'lib/dependency_spy/dtos/dependency.rb', line 75 def to_json(*args) to_map.to_json(*args) end |
#to_map ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/dependency_spy/dtos/dependency.rb', line 59 def to_map map = {} members.each do |m| if !self[m] || (self[m].is_a?(String) && self[m].empty?) || (self[m].is_a?(Array) && self[m].none?) next elsif self[m].is_a?(Struct) map[m.to_s] = self[m].to_map else map[m.to_s] = self[m] end end map end |
#to_yaml(*args) ⇒ Object
79 80 81 |
# File 'lib/dependency_spy/dtos/dependency.rb', line 79 def to_yaml(*args) to_map.to_yaml(*args) end |