Sha256: 98f0f111db58a05e298e1f3af6ee12fdbb5637838559665dae0dc880bc089bb7

Contents?: true

Size: 720 Bytes

Versions: 5

Compression:

Stored size: 720 Bytes

Contents

# Represents a Loops command.
class Loops::Command
  # @return [Engine]
  #   The instance of {Engine} to execute command in.
  attr_reader :engine

  # @return [Hash<String, Object>]
  #   The hash of (parsed) command-line options.
  attr_reader :options

  # Initializes a new {Command} instance.
  def initialize
  end

  # Invoke a command.
  #
  # Initiaizes {#engine} and {#options} variables and
  # executes a command.
  #
  def invoke(engine, options)
    @engine = engine
    @options = options

    execute
  end

  # A command entry point. Should be overridden in descendants.
  #
  def execute
    raise 'Generic command has no actions'
  end
end

# All Loops command registered.
module Loops::Commands
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
qik-loops-2.1.4 lib/loops/command.rb
qik-loops-2.1.3 lib/loops/command.rb
qik-loops-2.1.0 lib/loops/command.rb
loops-2.0.1 lib/loops/command.rb
loops-2.0.0 lib/loops/command.rb