Module: Fluxo::Operation::Constructor::ClassMethods

Defined in:
lib/fluxo/operation/constructor.rb

Instance Method Summary collapse

Instance Method Details

#def_Operation(op_module) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/fluxo/operation/constructor.rb', line 15

def def_Operation(op_module)
  tap do |klass|
    op_module.define_singleton_method(:Operation) do |*attrs|
      klass.Operation(*attrs)
    end
  end
end

#inherited(subclass) ⇒ Object



11
12
13
# File 'lib/fluxo/operation/constructor.rb', line 11

def inherited(subclass)
  subclass.instance_variable_set(:@attribute_names, @attribute_names.dup)
end

#Operation(*attrs) ⇒ Object



23
24
25
26
27
# File 'lib/fluxo/operation/constructor.rb', line 23

def Operation(*attrs)
  Class.new(self).tap do |klass|
    klass.attributes(*attrs)
  end
end