Module: Direction

Defined in:
lib/direction.rb,
lib/direction/version.rb

Overview

relationship between objects.

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#command(options) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/direction.rb', line 17

def command(options)
  method_defs = []
  options.each_pair do |key, value|
    Array(key).map do |command_name|
      method_defs.unshift %{
        def #{command_name}(*args, &block)
          #{value}.__send__(:#{command_name})
          self
        end
      }
    end
  end
  self.class_eval method_defs.join(' ')
end