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:



9
10
11
12
13
# File 'lib/eac_templates/sources/single.rb', line 9

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

  new(object.to_pathname)
end

Instance Method Details

#search(subpath) ⇒ Pathname?

Returns:

  • (Pathname, nil)


21
22
23
24
# File 'lib/eac_templates/sources/single.rb', line 21

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

#to_sString

Returns:

  • (String)


27
28
29
# File 'lib/eac_templates/sources/single.rb', line 27

def to_s
  "#{self.class.name}[#{path}]"
end