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

#to_sString

Returns:

  • (String)


29
30
31
# File 'lib/eac_templates/sources/single.rb', line 29

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