Sha256: aa87416a0a114a2146e292d52fc7e091416960fd030705724b777bba69f036d4

Contents?: true

Size: 794 Bytes

Versions: 195

Compression:

Stored size: 794 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module EacCli
  class Speaker
    module Options
      common_concern do
        enable_listable
        lists.add_symbol :option, :out_out, :err_out, :in_in, :parent, :err_line_prefix
      end

      def err_out
        option(OPTION_ERR_OUT, ::EacCli::Speaker::STDERR)
      end

      def out_out
        option(OPTION_OUT_OUT, ::EacCli::Speaker::STDOUT)
      end

      def in_in
        option(OPTION_IN_IN, ::EacCli::Speaker::STDIN)
      end

      def err_line_prefix
        option(OPTION_ERR_LINE_PREFIX, '')
      end

      def parent
        options[OPTION_PARENT]
      end

      def option(key, default)
        options[key] || parent.if_present(default) { |v| v.send(__METHOD__) }
      end
    end
  end
end

Version data entries

195 entries across 195 versions & 4 rubygems

Version Path
eac_tools-0.76.0 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_tools-0.75.2 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_cli-0.37.0 lib/eac_cli/speaker/options.rb
eac_tools-0.75.1 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_tools-0.75.0 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_tools-0.74.1 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_tools-0.74.0 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_cli-0.36.0 lib/eac_cli/speaker/options.rb
eac_tools-0.73.0 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_tools-0.72.0 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_tools-0.70.1 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_tools-0.70.0 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_tools-0.69.1 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_tools-0.69.0 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_cli-0.35.1 lib/eac_cli/speaker/options.rb
eac_cli-0.34.1 lib/eac_cli/speaker/options.rb
eac_tools-0.68.0 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_tools-0.67.1 sub/eac_cli/lib/eac_cli/speaker/options.rb
eac_cli-0.35.0 lib/eac_cli/speaker/options.rb
eac_tools-0.67.0 sub/eac_cli/lib/eac_cli/speaker/options.rb