class Grouik::Types::Loadables
Get filtered loadables, using ignores regexp
@return [Array<Grouik::Loadable>]
Public Instance Methods
add_file(file, basedir = nil)
click to toggle source
@return [self]
# File src/lib/grouik/types.rb, line 36 def add_file(file, basedir = nil) self.push(make_loadable(basedir, file)) self end
ignores(regexps)
click to toggle source
Removes ignored patterns (regexps)
@param [Array<Regexp>] regexps @return [self]
# File src/lib/grouik/types.rb, line 21 def ignores(regexps) filter = lambda do |loadable, regexps| regexps.each do |regexp| return true if loadable and regexp.match(loadable.to_s) end false end self.clone.delete_if do |loadable| filter.call(loadable, regexps) end end
make_loadable(*args)
click to toggle source
@return [Grouik::Loadable]
# File src/lib/grouik/types.rb, line 43 def make_loadable(*args) Grouik.get(:loadable_factory).call(*args) end