Module: StateFu::Interface::Aliases

Defined in:
lib/interface.rb

Class Method Summary collapse

Class Method Details

.extended(base) ⇒ Object

define aliases that won’t clobber existing methods - so we can be liberal with them.



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

def self.extended(base)
  base.extend SoftAlias
  base.class_eval do
    # instance method aliases
    soft_alias :state_fu          => [:stfu, :fu, :stateful, :workflow, :engine, :machine, :context]
    soft_alias :state_fu_bindings => [:bindings, :workflows, :engines, :machines, :contexts]
    soft_alias :state_fu!         => [:stfu!, :initialize_machines!, :initialize_state!]
    class << self
      extend SoftAlias
      # class method aliases
      soft_alias :state_fu_machine       => [:stfu, :state_fu, :workflow, :stateful, :statefully, :state_machine, :engine]
      soft_alias :state_fu_machines      => [:stfus, :state_fus, :workflows, :engines]
    end
  end
end