Class: Ea::Cli::Command::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ea/cli/command/base.rb

Overview

Shared base for all CLI commands.

Provides:

  • Options Hash access (read-only)
  • Output formatter resolution from :format option
  • Standalone QEA database loading (no lutaml-uml required)
  • UML document parsing (lazy-loads lutaml-uml)
  • File existence validation

Subclasses implement #call and may use the protected helpers.

Direct Known Subclasses

Convert, Diagrams, Diff, Export, Info, Lint, List, Mdg, Parse, Query, Render, Spa, Stats, Svg, Validate

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



17
18
19
# File 'lib/ea/cli/command/base.rb', line 17

def initialize(options = {})
  @options = options
end

Instance Method Details

#callObject

Template method — subclasses implement.

Raises:

  • (NotImplementedError)

    if not overridden



23
24
25
# File 'lib/ea/cli/command/base.rb', line 23

def call
  raise NotImplementedError, "#{self.class}#call not implemented"
end