Class: Bundler::PubGrub::Package
- Inherits:
-
Object
- Object
- Bundler::PubGrub::Package
- Defined in:
- lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb
Constant Summary collapse
- ROOT =
Package.new(:root)
- ROOT_VERSION =
0
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(name) ⇒ Package
constructor
A new instance of Package.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Package
Returns a new instance of Package.
8 9 10 |
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb', line 8 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb', line 6 def name @name end |
Class Method Details
.root ⇒ Object
23 24 25 |
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb', line 23 def self.root ROOT end |
.root?(package) ⇒ Boolean
31 32 33 34 35 36 37 |
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb', line 31 def self.root?(package) if package.respond_to?(:root?) package.root? else package == root end end |
.root_version ⇒ Object
27 28 29 |
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb', line 27 def self.root_version ROOT_VERSION end |
Instance Method Details
#<=>(other) ⇒ Object
16 17 18 |
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb', line 16 def <=>(other) name <=> other.name end |
#inspect ⇒ Object
12 13 14 |
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb', line 12 def inspect "#<#{self.class} #{name.inspect}>" end |
#to_s ⇒ Object
39 40 41 |
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb', line 39 def to_s name.to_s end |