Class: Lutaml::Cli::Commands::BaseCommand
- Inherits:
-
Object
- Object
- Lutaml::Cli::Commands::BaseCommand
- Defined in:
- lib/lutaml/cli/commands/base_command.rb
Overview
BaseCommand provides common functionality for all command handlers
All command classes should inherit from this base class to access common utilities like repository loading, error handling, and output formatting.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
-
#execute ⇒ Object
Execute the command (to be implemented by subclasses).
-
#initialize(repository = nil, options = {}) ⇒ BaseCommand
constructor
Initialize command with repository and options.
Constructor Details
#initialize(repository = nil, options = {}) ⇒ BaseCommand
Initialize command with repository and options
Repository instance
21 22 23 24 |
# File 'lib/lutaml/cli/commands/base_command.rb', line 21 def initialize(repository = nil, = {}) @repository = repository @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/lutaml/cli/commands/base_command.rb', line 14 def @options end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
14 15 16 |
# File 'lib/lutaml/cli/commands/base_command.rb', line 14 def repository @repository end |
Instance Method Details
#execute ⇒ Object
Execute the command (to be implemented by subclasses)
29 30 31 32 |
# File 'lib/lutaml/cli/commands/base_command.rb', line 29 def execute raise NotImplementedError, "#{self.class.name} must implement #execute" end |