Class: Doubleshot::Resolver::GemResolver::Solver::VariableRow
- Defined in:
- lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb
Instance Attribute Summary collapse
-
#artifact ⇒ Object
readonly
Returns the value of attribute artifact.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #add_source(source) ⇒ Object
- #bind(value) ⇒ Object
- #bound? ⇒ Boolean
-
#initialize(artifact, source) ⇒ VariableRow
constructor
A new instance of VariableRow.
- #last_source ⇒ Object
- #remove_source(source) ⇒ Object
- #unbind ⇒ Object
Constructor Details
#initialize(artifact, source) ⇒ VariableRow
Returns a new instance of VariableRow.
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
#artifact ⇒ Object (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 |
#sources ⇒ Object (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 |
#value ⇒ Object (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
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
35 36 37 |
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 35 def bound? !@value.nil? end |
#last_source ⇒ Object
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
40 41 42 |
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 40 def remove_source(source) @sources.delete(source) end |
#unbind ⇒ Object
31 32 33 |
# File 'lib/doubleshot/resolver/gem_resolver/solver/variable_row.rb', line 31 def unbind @value = nil end |