Sha256: a9b79ca6b9a2d25a16210299871a345c000a147880c263aaaee2367840a6148d
Contents?: true
Size: 619 Bytes
Versions: 18
Compression:
Stored size: 619 Bytes
Contents
module WhereTo class Location include Comparable attr_accessor :folder, :filename, :location def initialize(from_location) @location = from_location set_filename_folder_from_location end def <=>(other) location <=> other end private def set_filename_folder_from_location split = location.split '/' last = split[-1] if File.extname(last) == '' # No extension; is a directory @folder = location + '/' @filename = '' else @filename = split.pop @folder = split.join('/') + '/' end end end end
Version data entries
18 entries across 18 versions & 1 rubygems