Class: Bundler::PubGrub::Assignment

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(term, cause, decision_level, index) ⇒ Assignment

Returns a new instance of Assignment.



4
5
6
7
8
9
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb', line 4

def initialize(term, cause, decision_level, index)
  @term = term
  @cause = cause
  @decision_level = decision_level
  @index = index
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause.



3
4
5
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb', line 3

def cause
  @cause
end

#decision_levelObject (readonly)

Returns the value of attribute decision_level.



3
4
5
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb', line 3

def decision_level
  @decision_level
end

#indexObject (readonly)

Returns the value of attribute index.



3
4
5
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb', line 3

def index
  @index
end

#termObject (readonly)

Returns the value of attribute term.



3
4
5
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb', line 3

def term
  @term
end

Class Method Details

.decision(package, version, decision_level, index) ⇒ Object



11
12
13
14
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb', line 11

def self.decision(package, version, decision_level, index)
  term = Term.new(VersionConstraint.exact(package, version), true)
  new(term, :decision, decision_level, index)
end

Instance Method Details

#decision?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb', line 16

def decision?
  cause == :decision
end