Sha256: 06bbd86fe95fbaff20e7bd086788cc0284854c6661b4d38a3f64b625aa32409c
Contents?: true
Size: 610 Bytes
Versions: 7
Compression:
Stored size: 610 Bytes
Contents
module Mireru class Container def initialize(files=[]) @files = files.select {|file| file?(file) } end def empty? @files.empty? end def size @files.size end def pop(complement_file=nil) @files.unshift(complement_file) if complement_file @files.pop end def shift(complement_file=nil) @files.push(complement_file) if complement_file @files.shift end private def file?(file) unless file return false end unless File.file?(file) return false end true end end end
Version data entries
7 entries across 7 versions & 1 rubygems