Sha256: d2be64cd787a179dff868824b28d291acf737a44d346a2374cfcefe4e3aff65f

Contents?: true

Size: 220 Bytes

Versions: 15

Compression:

Stored size: 220 Bytes

Contents

# frozen_string_literal: true

module Slop
  # Add an option to convert a string to a symbol
  class SymbolOption < Option
    def call(value)
      return value.to_sym unless value.empty?

      value
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ynab_convert-2.0.6 lib/slop/symbol.rb
ynab_convert-2.0.5 lib/slop/symbol.rb
ynab_convert-2.0.4 lib/slop/symbol.rb
ynab_convert-2.0.3 lib/slop/symbol.rb
ynab_convert-2.0.1 lib/slop/symbol.rb
ynab_convert-2.0.0 lib/slop/symbol.rb
ynab_convert-1.0.8 lib/slop/symbol.rb
ynab_convert-1.0.7 lib/slop/symbol.rb
ynab_convert-1.0.6 lib/slop/symbol.rb
ynab_convert-1.0.5 lib/slop/symbol.rb
ynab_convert-1.0.4 lib/slop/symbol.rb
ynab_convert-1.0.3 lib/slop/symbol.rb
ynab_convert-1.0.2 lib/slop/symbol.rb
ynab_convert-1.0.1 lib/slop/symbol.rb
ynab_convert-0.1.0.pre lib/slop/symbol.rb