Class: Hanami::Commands::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/commands/command.rb

Overview

Abstract command

Since:

  • 0.9.0

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Command

Returns a new instance of Command

Parameters:

  • options (Hash)

    Environment's options

Since:

  • 0.9.0


41
42
43
44
45
46
47
48
# File 'lib/hanami/commands/command.rb', line 41

def initialize(options)
  @environment = Hanami::Environment.new(options)
  @environment.require_project_environment
  @configuration = Hanami.configuration

  requirements.resolved('environment', environment)
  requirements.resolve(self.class.requirements)
end

Class Method Details

.inherited(component) ⇒ Object

Since:

  • 0.9.0


12
13
14
15
16
17
18
19
# File 'lib/hanami/commands/command.rb', line 12

def self.inherited(component)
  super

  component.class_eval do
    @_requirements = Concurrent::Array.new
    extend ClassMethods
  end
end