module ServiceActor::Attributable::ClassMethods

Public Instance Methods

inherited(child) click to toggle source
Calls superclass method
# File lib/service_actor/attributable.rb, line 16
def inherited(child)
  super

  child.inputs.merge!(inputs)
  child.outputs.merge!(outputs)
end
input(name, **arguments) click to toggle source
# File lib/service_actor/attributable.rb, line 23
def input(name, **arguments)
  inputs[name] = arguments

  define_method(name) do
    result[name]
  end

  protected name
end
inputs() click to toggle source
# File lib/service_actor/attributable.rb, line 33
def inputs
  @inputs ||= {}
end
output(name, **arguments) click to toggle source
# File lib/service_actor/attributable.rb, line 37
def output(name, **arguments)
  outputs[name] = arguments

  define_method(name) do
    result[name]
  end

  define_method("#{name}=") do |value|
    result[name] = value
  end

  protected name, "#{name}="
end
outputs() click to toggle source
# File lib/service_actor/attributable.rb, line 51
def outputs
  @outputs ||= {}
end