Sha256: 3c7de5035d3581c0c85c96a507b02360e32c4eaa9ec97ee11d9bb55e4f0d9f9f

Contents?: true

Size: 1.02 KB

Versions: 18

Compression:

Stored size: 1.02 KB

Contents

module Pantograph
  # This class is used to call other actions from within actions
  # We use a separate class so that we can easily identify when
  # we have dependencies between actions
  class OtherAction
    attr_accessor :runner

    def initialize(runner)
      self.runner = runner
    end

    # Allows the user to call an action from an action
    def method_missing(method_sym, *arguments, &_block)
      # We have to go inside the pantograph directory
      # since in the pantograph runner.rb we do the following
      #   custom_dir = ".."
      #   Dir.chdir(custom_dir) do
      # this goes one folder up, since we're inside the "pantograph"
      # folder at that point
      # Since we call an action from an action we need to go inside
      # the pantograph folder too

      self.runner.trigger_action_by_name(method_sym,
                                         PantographCore::PantographFolder.path,
                                         true,
                                         *arguments)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
pantograph-0.1.22 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.21 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.20 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.19 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.17 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.16 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.15 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.14 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.13 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.12 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.10 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.8 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.7 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.6 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.4 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.3 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.1 pantograph/lib/pantograph/other_action.rb
pantograph-0.1.0 pantograph/lib/pantograph/other_action.rb