Class: EacTemplates::Sources::Single

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_templates/sources/single.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.assert(object) ⇒ EacTemplates::Sources::Single

Parameters:

Returns:



11
12
13
14
15
# File 'lib/eac_templates/sources/single.rb', line 11

def assert(object)
  return object if object.is_a?(self)

  new(object.to_pathname)
end

Instance Method Details

#search(subpath) ⇒ Pathname?

Returns:

  • (Pathname, nil)


23
24
25
26
# File 'lib/eac_templates/sources/single.rb', line 23

def search(subpath)
  r = path.join(subpath)
  r.exist? ? r : nil
end