Sha256: 522f3fd828df94f8b1e84adcb1fbd46598df19fdcb81147158bafe2c3be4b3b8
Contents?: true
Size: 672 Bytes
Versions: 31
Compression:
Stored size: 672 Bytes
Contents
# Class to delay the case options configuration (declaration vs configuration) class Eco::API::UseCases::Cli class Option attr_accessor :name, :desc, :callback def initialize(name, desc, &block) @name, @desc, @callback = name, desc, block end def dup(name: self.name, desc: self.desc, &block) self.class.new(name, desc, &(block || callback)) end def link_case(cli_config_case) raise ArgumentError, "cli_config_case must have an 'add_option' method. Given: #{cli_config_case.class}" unless cli_config_case.respond_to?(:add_option) cli_config_case.add_option(name, desc, &callback) end end end
Version data entries
31 entries across 31 versions & 1 rubygems