Module: Redistat::Options::ClassMethods

Defined in:
lib/redistat/mixins/options.rb

Instance Method Summary collapse

Instance Method Details

#option_accessor(*opts) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/redistat/mixins/options.rb', line 9

def option_accessor(*opts)
  opts.each do |option|
    define_method(option) do |*args|
      if !args.first.nil?
        options[option.to_sym] = args.first
      else
        options[option.to_sym] || nil
      end
    end
  end
end