Module: ServiceActor::Playable::ClassMethods

Defined in:
lib/service_actor/playable.rb

Instance Method Summary collapse

Instance Method Details

#alias_input(**options) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/service_actor/playable.rb', line 24

def alias_input(**options)
  options.each_key do |new|
    ServiceActor::ArgumentsValidator.validate_origin_name(
      new, origin: :alias
    )
  end

  lambda do |actor|
    options.each do |new, original|
      define_alias_input(actor, new, original)
    end
  end
end

#inherited(child) ⇒ Object



42
43
44
45
46
# File 'lib/service_actor/playable.rb', line 42

def inherited(child)
  super

  child.play_actors.concat(play_actors)
end

#play(*actors, **options) ⇒ Object



20
21
22
# File 'lib/service_actor/playable.rb', line 20

def play(*actors, **options)
  play_actors.push(actors: actors, **options)
end

#play_actorsObject



38
39
40
# File 'lib/service_actor/playable.rb', line 38

def play_actors
  @play_actors ||= []
end