Sha256: 84bbeb190dec3dc91d2727a362e26b6a8a6a1a109aa97aa6a6d0cad1c0347e53

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

module Foobara
  class Command
    include TruncatedInspect

    include Concerns::Description
    include Concerns::Namespace

    include Concerns::InputsType
    include Concerns::ErrorsType
    include Concerns::ResultType

    include Concerns::Inputs
    include Concerns::Errors
    include Concerns::Result

    include Concerns::Runtime
    include Concerns::Callbacks
    include Concerns::StateMachine
    include Concerns::Transactions
    include Concerns::Entities
    include Concerns::Subcommands
    include Concerns::DomainMappers
    include Concerns::Reflection

    # TODO: this feels like a hack and shouldn't be necessary. Let's try to fix Concern class inheritance, instead.
    self.subclass_defined_callbacks ||= Foobara::Callback::Registry::SingleAction.new

    attr_reader :raw_inputs

    def initialize(inputs = {})
      @raw_inputs = inputs
      super()
    end
  end

  Command.after_subclass_defined do |subclass|
    Command.all << subclass
    subclass.define_command_named_function
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foobara-0.0.38 projects/command/src/command.rb
foobara-0.0.37 projects/command/src/command.rb
foobara-0.0.36 projects/command/src/command.rb
foobara-0.0.35 projects/command/src/command.rb
foobara-0.0.34 projects/command/src/command.rb