Sha256: 7f23e7a0ab545941cb09d5401d9d6a14921826eab54f511fcbf665ab147e5f9c
Contents?: true
Size: 634 Bytes
Versions: 12
Compression:
Stored size: 634 Bytes
Contents
# frozen_string_literal: true require_relative 'base' module RubyVault module Options module Values class Boolean < Base def resolve return nil if @value.nil? return @value if a_boolean?(@value) return true if true_as_string?(@value) false end def render resolve&.to_s end private def a_boolean?(value) value.is_a?(TrueClass) || value.is_a?(FalseClass) end def true_as_string?(value) value.respond_to?(:downcase) && value.downcase == 'true' end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems