Module: Mooncell::Respond

Defined in:
lib/mooncell/respond.rb

Overview

Respond Generator

Examples:


class Move
  include Mooncell::Respond
end

Since:

  • 0.1.0

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/mooncell/respond.rb', line 18

def self.included(base)
  command = Kernel.const_get(base.name.sub(/Responds/, 'Commands'))

  base.class_eval do
    extend Forwardable
    extend ClassMethods
    include InstanceMethods

    delegate command.exposures => 'command'
  end
end