Class: Bundler::Restrict::Gem
- Inherits:
-
Object
- Object
- Bundler::Restrict::Gem
- Defined in:
- lib/bundler/restrict/gem.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Gem
constructor
A new instance of Gem.
- #version(number) ⇒ Object
- #versions ⇒ Object
Constructor Details
#initialize(name) ⇒ Gem
Returns a new instance of Gem.
9 10 11 |
# File 'lib/bundler/restrict/gem.rb', line 9 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/bundler/restrict/gem.rb', line 7 def name @name end |
Instance Method Details
#version(number) ⇒ Object
13 14 15 |
# File 'lib/bundler/restrict/gem.rb', line 13 def version(number) versions.find { |ver| ver.number == number } end |
#versions ⇒ Object
17 18 19 |
# File 'lib/bundler/restrict/gem.rb', line 17 def versions Gems.versions(@name).map { |info| GemVersion.new(self, info) } end |