Sha256: 2b8d62d67a26f91fcfdfed3b810306a993895a9219c0f074b53d01c4027c3ed0
Contents?: true
Size: 670 Bytes
Versions: 14
Compression:
Stored size: 670 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
14 entries across 14 versions & 1 rubygems