Sha256: a2bfd1480d486b87a9de10ea909db6abe7a5d6f893cd6fa062f01e413bf5bcc7

Contents?: true

Size: 576 Bytes

Versions: 16

Compression:

Stored size: 576 Bytes

Contents

module Vos
  class Box
    module Marks
      def mark! key              
        marks_dir.file(key).create
        @marks_cache = nil
      end

      def has_mark? key
        marks_cache.include? key.to_s
      end
      alias_method :marked?, :has_mark?
    
      def clear_marks!
        marks_dir.destroy
        @marks_cache = nil
      end
      
      def marks_dir
        dir "/marks"
      end
      
      protected
        def marks_cache          
          @marks_cache ||= marks_dir.files(bang: false).collect{|file| file.name}
        end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vos-0.3.12 lib/vos/box/marks.rb
vos-0.3.11 lib/vos/box/marks.rb
vos-0.3.10 lib/vos/box/marks.rb
vos-0.3.9 lib/vos/box/marks.rb
vos-0.3.8 lib/vos/box/marks.rb
vos-0.3.7 lib/vos/box/marks.rb
vos-0.3.6 lib/vos/box/marks.rb
vos-0.3.5 lib/vos/box/marks.rb
vos-0.3.4 lib/vos/box/marks.rb
vos-0.3.3 lib/vos/box/marks.rb
vos-0.3.2 lib/vos/box/marks.rb
vos-0.3.1 lib/vos/box/marks.rb
vos-0.3 lib/vos/box/marks.rb
vos-0.2.1 lib/vos/box/marks.rb
vos-0.2 lib/vos/box/marks.rb
vos-0.1.4 lib/vos/box/marks.rb