Module: Lijab::Commands::CommandMixin

Included in:
Command
Defined in:
lib/lijab/commands.rb

Instance Method Summary collapse

Instance Method Details

#define_meta(*names) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/lijab/commands.rb', line 9

def define_meta(*names)
   class_eval do
      names.each do |name|
         define_method(name) do |*args|
            if args.size == 0
               instance_variable_get("@#{name}")
            else
               instance_variable_set("@#{name}", *args)
            end
         end
      end
   end
end