123456789_123456789_123456789_123456789_123456789_

Class: Bundler::DepProxy

Relationships & Source Files
Inherits: Object
Defined in: lib/bundler/dep_proxy.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(dep, platform) ⇒ DepProxy

[ GitHub ]

  
# 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) (private)

[ GitHub ]

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

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

Instance Attribute Details

#__platform (readonly)

[ GitHub ]

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

attr_reader :__platform, :dep

#dep (readonly)

[ GitHub ]

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

attr_reader :__platform, :dep

Instance Method Details

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

[ GitHub ]

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

def ==(other)
  return false if other.class != self.class
  dep == other.dep && __platform == other.__platform
end

#eql?(other)

Alias for #==.

[ GitHub ]

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

alias_method :eql?, :==

#hash

[ GitHub ]

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

def hash
  @hash ||= [dep, __platform].hash
end

#name

[ GitHub ]

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

def name
  @dep.name
end

#requirement

[ GitHub ]

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

def requirement
  @dep.requirement
end

#to_s

[ GitHub ]

  
# 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

#type

[ GitHub ]

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

def type
  @dep.type
end