Class: Charted::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/charted/config.rb

Class Method Summary collapse

Class Method Details

.attr_option(*names) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/charted/config.rb', line 18

def self.attr_option(*names)
  names.each do |name|
    define_method(name) do |*args|
      value = args[0]
      instance_variable_set("@#{name}".to_sym, value) if !value.nil?
      instance_variable_get("@#{name}".to_sym)
    end
  end
end