Sha256: f04226aad2e3d2aa4928590ba73bd4436e5b7cb8ed943a9a474e4c0e1d1e6eac
Contents?: true
Size: 708 Bytes
Versions: 25
Compression:
Stored size: 708 Bytes
Contents
module Rubicure module Concerns # utility methods module Util # @param arg [Date,Time,String] # # @return [Date] arg is String, Date or Time # @return [nil] arg is other def to_date(arg) case arg when Date arg when Time arg.to_date when String begin Date.parse(arg) rescue nil end else nil end end module_function # @param yaml_file [String] # @return [Hash] def load_yaml_file(yaml_file) YAML.safe_load(File.read(yaml_file), permitted_classes: [Date], aliases: true) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems