Class: Gem::MiniMirror::Dependency

Inherits:
Object
  • Object
show all
Defined in:
lib/rubygems/mini_mirror/dependency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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)
  options = args.extract_options!
  srcs = args.empty? ? nil : args.flatten
  @sources = srcs || Gem.sources
  @dependency = Gem::Dependency.new(name,requirements)
  @development = !! options[:development]
  @all = !! (options[: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

#dependencyObject (readonly)

Returns the value of attribute dependency.



5
6
7
# File 'lib/rubygems/mini_mirror/dependency.rb', line 5

def dependency
  @dependency
end

#sourcesObject (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

Returns:

  • (Boolean)


16
17
18
# File 'lib/rubygems/mini_mirror/dependency.rb', line 16

def all?
  @all
end

#development?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/rubygems/mini_mirror/dependency.rb', line 20

def development?
  @development
end