Sha256: 31f9e6b4fee8a89b68a526be64945aee06319f377d8f892f6c75d507b2b27ab5

Contents?: true

Size: 785 Bytes

Versions: 13

Compression:

Stored size: 785 Bytes

Contents

# frozen_string_literal: true

require_relative 'values/boolean'
require_relative 'values/string'
require_relative 'values/complex'
require_relative 'values/key_value'

module RubyGitCrypt
  module Options
    module Values
      def self.boolean(value)
        Boolean.new(value)
      end

      def self.string(value)
        String.new(value)
      end

      def self.complex(value)
        Complex.new(value)
      end

      def self.key_value(key, value)
        KeyValue.new(key, value)
      end

      def self.resolve(type)
        case type
        when :string then Values::String
        when :boolean then Values::Boolean
        when :complex then Values::Complex
        when :key_value then Values::KeyValue
        else type
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ruby_git_crypt-0.2.0.pre.2 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.2.0.pre.1 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0.pre.10 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0.pre.9 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0.pre.8 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0.pre.7 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0.pre.6 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0.pre.5 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0.pre.4 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0.pre.3 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0.pre.2 lib/ruby_git_crypt/options/values.rb
ruby_git_crypt-0.1.0.pre.1 lib/ruby_git_crypt/options/values.rb