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

Returns a new instance of DepProxy



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

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)



44
45
46
# File 'lib/bundler/dep_proxy.rb', line 44

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

Instance Attribute Details

#__platformObject (readonly)

Returns the value of attribute __platform



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

def __platform
  @__platform
end

#depObject (readonly)

Returns the value of attribute dep



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

def dep
  @dep
end

Instance Method Details

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



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

def ==(other)
  return if other.nil?
  dep == other.dep && __platform == other.__platform
end

#hashObject



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

def hash
  @hash ||= dep.hash
end

#nameObject



27
28
29
# File 'lib/bundler/dep_proxy.rb', line 27

def name
  @dep.name
end

#requirementObject



31
32
33
# File 'lib/bundler/dep_proxy.rb', line 31

def requirement
  @dep.requirement
end

#to_sObject



35
36
37
38
39
40
# File 'lib/bundler/dep_proxy.rb', line 35

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

#typeObject



23
24
25
# File 'lib/bundler/dep_proxy.rb', line 23

def type
  @dep.type
end