class AdLint::Cc1::ValueVersionController::Version

Attributes

initial_values[R]
values[RW]

Public Class Methods

new(vals, original = false) click to toggle source
# File lib/adlint/cc1/value.rb, line 2835
def initialize(vals, original = false)
  @values = vals
  @initial_values = []
  @state = original ? :original : :forking
end

Public Instance Methods

fork_from(base_ver) click to toggle source
# File lib/adlint/cc1/value.rb, line 2856
def fork_from(base_ver)
  if forking?
    @values = base_ver.values.map { |mval| mval.fork }
    @initial_values = @values.each_with_object([]) { |val, ary|
      ary.push(val.to_single_value.dup)
    }
    @state = :forked
  end
end
forked?() click to toggle source
# File lib/adlint/cc1/value.rb, line 2852
def forked?
  @state == :forked
end
forking?() click to toggle source
# File lib/adlint/cc1/value.rb, line 2848
def forking?
  @state == :forking
end
original?() click to toggle source
# File lib/adlint/cc1/value.rb, line 2844
def original?
  @state == :original
end