Files

Class/Module Index [+]

Quicksearch

BinData::CopyOnChangePlugin

Logic for the :copy_on_change parameter

Public Instance Methods

copy_previous_value(obj) click to toggle source
# File lib/bindata/choice.rb, line 189
def copy_previous_value(obj)
  current_selection = selection
  prev = get_previous_choice(current_selection)
  obj.assign(prev) unless prev.nil?
  remember_current_selection(current_selection)
end
current_choice() click to toggle source
# File lib/bindata/choice.rb, line 183
def current_choice
  obj = super
  copy_previous_value(obj)
  obj
end
get_previous_choice(selection) click to toggle source
# File lib/bindata/choice.rb, line 196
def get_previous_choice(selection)
  if selection != @last_selection and @last_selection != nil
    @choices[@last_selection]
  else
    nil
  end
end
remember_current_selection(selection) click to toggle source
# File lib/bindata/choice.rb, line 204
def remember_current_selection(selection)
  @last_selection = selection
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.