Sha256: 1934b8918a63ecc2859a1e12a19adcaabf4235b693f137a769cbc47137f24d4b

Contents?: true

Size: 816 Bytes

Versions: 7

Compression:

Stored size: 816 Bytes

Contents

require 'qooxview/helpers/config_base'

class ConfigBases < Entities
  def add_config
    @@functions = %w( take over world now or never linux on desktop ).to_sym
    @@functions_base = {:take => [:now, :never], :linux => [:now]}
    @@functions_conflict = [[:now, :or]]

    value_list :value, "%w( one two three )"
    value_int :integer
  end
end

class ConfigBase < Entity
  def setup_defaults
    self.integer ||= 0
  end

  def update(action, value_new, value_old = nil)
    dputs(3){"Action #{action.inspect} changed to #{value_new.inspect} from "+
        "#{value_old.inspect}"}
    case action
      when :function_add
        if value_new.index :now
          self.integer += 1
        end
      when :function_del
        if value_new.index :now
          self.integer += 3
        end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
qooxview-1.9.1312 test/entities/config.rb
qooxview-1.9.13.pre.12 test/entities/config.rb
qooxview-1.9.13.pre.11 test/entities/config.rb
qooxview-1.9.13.pre.10 test/entities/config.rb
qooxview-1.9.11 test/entities/config.rb
qooxview-1.9.10 test/entities/config.rb
qooxview-1.9.9 test/entities/config.rb