Class: Doubleshot::Resolver::GemResolver::Solver::VariableRow

Inherits:
Object
  • Object
show all
Defined in:
lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(artifact, source) ⇒ VariableRow

Returns a new instance of VariableRow.

Parameters:



12
13
14
15
16
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 12

def initialize(artifact, source)
  @artifact = artifact
  @value = nil
  @sources = Array(source)
end

Instance Attribute Details

#artifactObject (readonly)

Returns the value of attribute artifact.



6
7
8
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 6

def artifact
  @artifact
end

#sourcesObject (readonly)

Returns the value of attribute sources.



8
9
10
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 8

def sources
  @sources
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 7

def value
  @value
end

Instance Method Details

#add_source(source) ⇒ Object

Parameters:



19
20
21
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 19

def add_source(source)
  @sources << source
end

#bind(value) ⇒ Object



27
28
29
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 27

def bind(value)
  @value = value
end

#bound?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 35

def bound?
  !@value.nil?
end

#last_sourceObject



23
24
25
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 23

def last_source
  @sources.last
end

#remove_source(source) ⇒ Object

Parameters:



40
41
42
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 40

def remove_source(source)
  @sources.delete(source)
end

#unbindObject



31
32
33
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 31

def unbind
  @value = nil
end