Class: RandomStrings::Config

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

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Config

Returns a new instance of Config.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/random_strings.rb', line 5

def initialize(*args)
  args.each do |method_name|
    self.class.class_exec do

      define_method("#{method_name}") do
        eval "@#{method_name}"
      end
      define_method("#{method_name}=") do |inp|
        eval "@#{method_name}=inp"
      end
    end
  end
end