Class: Bundler::DepProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/dep_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dep, platform) ⇒ DepProxy



6
7
8
9
# File 'lib/bundler/dep_proxy.rb', line 6

def initialize(dep, platform)
  @dep = dep
  @__platform = platform
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &blk) ⇒ Object (private)



42
43
44
# File 'lib/bundler/dep_proxy.rb', line 42

def method_missing(*args, &blk)
  @dep.send(*args, &blk)
end

Instance Attribute Details

#__platformObject (readonly)

Returns the value of attribute __platform



4
5
6
# File 'lib/bundler/dep_proxy.rb', line 4

def __platform
  @__platform
end

#depObject (readonly)

Returns the value of attribute dep



4
5
6
# File 'lib/bundler/dep_proxy.rb', line 4

def dep
  @dep
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



15
16
17
# File 'lib/bundler/dep_proxy.rb', line 15

def ==(other)
  dep == other.dep && __platform == other.__platform
end

#hashObject



11
12
13
# File 'lib/bundler/dep_proxy.rb', line 11

def hash
  @hash ||= dep.hash
end

#nameObject



25
26
27
# File 'lib/bundler/dep_proxy.rb', line 25

def name
  @dep.name
end

#requirementObject



29
30
31
# File 'lib/bundler/dep_proxy.rb', line 29

def requirement
  @dep.requirement
end

#to_sObject



33
34
35
36
37
38
# File 'lib/bundler/dep_proxy.rb', line 33

def to_s
  s = name.dup
  s << " (#{requirement})" unless requirement == Gem::Requirement.default
  s << " #{__platform}" unless __platform == Gem::Platform::RUBY
  s
end

#typeObject



21
22
23
# File 'lib/bundler/dep_proxy.rb', line 21

def type
  @dep.type
end