Sha256: 5a35bf0760ed7b90ecfe7d2cb285131107225ffde6b44e05f690293a2c768fdb
Contents?: true
Size: 884 Bytes
Versions: 17
Compression:
Stored size: 884 Bytes
Contents
# encoding: utf-8 module TTY module Utils module_function BLANK_REGEX = /\A[[:space:]]*\z/o.freeze # Extract options hash from array argument # # @param [Array[Object]] args # # @api public def extract_options(args) options = args.last options.respond_to?(:to_hash) ? options.to_hash.dup : {} end def extract_options!(args) args.last.respond_to?(:to_hash) ? args.pop : {} end # Check if value is nil or an empty string # # @param [Object] value # the value to check # # @return [Boolean] # # @api public def blank?(value) value.nil? || value.respond_to?(:empty?) && value.empty? || BLANK_REGEX === value end # Deep copy object # # @api public def deep_copy(object) Marshal.load(Marshal.dump(object)) end end # Utils end # TTY
Version data entries
17 entries across 17 versions & 2 rubygems