lib/conjur/variable.rb in conjur-api-4.21.0 vs lib/conjur/variable.rb in conjur-api-4.22.0

- old
+ new

@@ -196,14 +196,20 @@ # # All of these return the same thing: # var.value # var.value 0 # var.value var.version_count # + # @example Get the value of an expired variable + # var.value nil, show_expired: true + # # @param [Integer] version the **1 based** version. + # @param options [Hash] + # @option options [Boolean, false] :show_expired show value even if variable has expired # @return [String] the value of the variable - def value(version = nil) + def value(version = nil, options = {}) url = 'value' - url << "?version=#{version}" if version + options['version'] = version if version + url << '?' + options.to_query unless options.empty? self[url].get.body end # Set the variable to expire after the given interval. The # interval can either be an ISO8601 duration or it can the number