Class: Gem::MiniMirror::Dependency
- Inherits:
-
Object
- Object
- Gem::MiniMirror::Dependency
- Defined in:
- lib/rubygems/mini_mirror/dependency.rb
Instance Attribute Summary collapse
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
Instance Method Summary collapse
- #all? ⇒ Boolean
- #development? ⇒ Boolean
-
#initialize(name, requirements, *args) ⇒ Dependency
constructor
A new instance of Dependency.
- #method_missing(*args) ⇒ Object
Constructor Details
#initialize(name, requirements, *args) ⇒ Dependency
Returns a new instance of Dependency.
7 8 9 10 11 12 13 14 |
# File 'lib/rubygems/mini_mirror/dependency.rb', line 7 def initialize(name, requirements, *args) = args. srcs = args.empty? ? nil : args.flatten @sources = srcs || Gem.sources @dependency = Gem::Dependency.new(name,requirements) @development = !! [:development] @all = !! ([:all] || true) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
24 25 26 |
# File 'lib/rubygems/mini_mirror/dependency.rb', line 24 def method_missing(*args) @dependency.send(*args) end |
Instance Attribute Details
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
5 6 7 |
# File 'lib/rubygems/mini_mirror/dependency.rb', line 5 def dependency @dependency end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
5 6 7 |
# File 'lib/rubygems/mini_mirror/dependency.rb', line 5 def sources @sources end |
Instance Method Details
#all? ⇒ Boolean
16 17 18 |
# File 'lib/rubygems/mini_mirror/dependency.rb', line 16 def all? @all end |
#development? ⇒ Boolean
20 21 22 |
# File 'lib/rubygems/mini_mirror/dependency.rb', line 20 def development? @development end |