Class: Gem::Prune::Version
- Inherits:
-
Object
- Object
- Gem::Prune::Version
- Defined in:
- lib/gem/prune/version.rb
Instance Attribute Summary collapse
-
#dependants ⇒ Object
readonly
Returns the value of attribute dependants.
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#gem ⇒ Object
readonly
Returns the value of attribute gem.
-
#keep ⇒ Object
Returns the value of attribute keep.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #clear_relationships ⇒ Object
-
#initialize(gem, raw) ⇒ Version
constructor
A new instance of Version.
- #inspect ⇒ Object
- #name ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(gem, raw) ⇒ Version
Returns a new instance of Version.
9 10 11 12 13 14 15 |
# File 'lib/gem/prune/version.rb', line 9 def initialize(gem, raw) @gem = gem @raw = raw @keep = false clear_relationships end |
Instance Attribute Details
#dependants ⇒ Object (readonly)
Returns the value of attribute dependants.
5 6 7 |
# File 'lib/gem/prune/version.rb', line 5 def dependants @dependants end |
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
6 7 8 |
# File 'lib/gem/prune/version.rb', line 6 def dependencies @dependencies end |
#gem ⇒ Object (readonly)
Returns the value of attribute gem.
3 4 5 |
# File 'lib/gem/prune/version.rb', line 3 def gem @gem end |
#keep ⇒ Object
Returns the value of attribute keep.
7 8 9 |
# File 'lib/gem/prune/version.rb', line 7 def keep @keep end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
4 5 6 |
# File 'lib/gem/prune/version.rb', line 4 def raw @raw end |
Instance Method Details
#<=>(other) ⇒ Object
39 40 41 |
# File 'lib/gem/prune/version.rb', line 39 def <=>(other) version <=> other.version end |
#clear_relationships ⇒ Object
34 35 36 37 |
# File 'lib/gem/prune/version.rb', line 34 def clear_relationships @dependants = [] @dependencies = [] end |
#inspect ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/gem/prune/version.rb', line 17 def inspect pretty = %{<Gem::Prune::Version } pretty << %{@name="#{name}" } pretty << %{@version="#{version}" } pretty << %{@dependants="#{dependants.map { |d| "#{d.name}-#{d.version}" }.join(' ') }" } pretty << %{@dependencies="#{dependencies.map { |d| "#{d.name}-#{d.version}" }.join(' ') }"} pretty << %{>} end |
#name ⇒ Object
26 27 28 |
# File 'lib/gem/prune/version.rb', line 26 def name raw.name end |
#version ⇒ Object
30 31 32 |
# File 'lib/gem/prune/version.rb', line 30 def version raw.version end |