Module: RubyCurses::ConfigSetup

Overview

module eventh

Instance Method Summary collapse

Instance Method Details

#cget(param) ⇒ Object

returns param from hash. Unused and untested.



482
483
484
# File 'lib/rbcurse/rwidget.rb', line 482

def cget param
  @config[param]
end

#config_setup(aconfig) ⇒ Object

this bypasses our methods and sets directly !



486
487
488
489
490
491
492
493
494
# File 'lib/rbcurse/rwidget.rb', line 486

def config_setup aconfig
  @config = aconfig
  # this creates a problem in 1.9.2 since variable_set sets @config 2010-08-22 19:05 RK
  #@config.each_pair { |k,v| variable_set(k,v) }
  keys = @config.keys
  keys.each do |e| 
    variable_set(e, @config[e])
  end
end

#configure(*val, &block) ⇒ Object

instance_variable_set(nvar, val) # we should not call this !!! bypassing



470
471
472
473
474
475
476
477
478
479
# File 'lib/rbcurse/rwidget.rb', line 470

def configure(*val , &block)
  case val.size
  when 1
    return @config[val[0]]
  when 2
    @config[val[0]] = val[1]
    variable_set(val[0], val[1]) 
  end
  instance_eval &block if block_given?
end

#variable_set(var, val) ⇒ Object

private



465
466
467
468
469
# File 'lib/rbcurse/rwidget.rb', line 465

def variable_set var, val
  #nvar = "@#{var}"
  send("#{var}", val) #rescue send("#{var}=", val)    # 2009-01-08 01:30 BIG CHANGE calling methods too here.
  #instance_variable_set(nvar, val)   # we should not call this !!! bypassing 
end