Module: Puppet::FileCollection::Lookup

Included in:
Network::Rights::Right, Parser::AST, Parser::Resource, Parser::Resource::Param, Type
Defined in:
lib/puppet/file_collection/lookup.rb

Overview

A simple module for looking up file paths and indexes in a file collection.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#file_indexObject

Returns the value of attribute file_index.



6
7
8
# File 'lib/puppet/file_collection/lookup.rb', line 6

def file_index
  @file_index
end

#lineObject

Returns the value of attribute line.



6
7
8
# File 'lib/puppet/file_collection/lookup.rb', line 6

def line
  @line
end

Instance Method Details

#fileObject



16
17
18
19
# File 'lib/puppet/file_collection/lookup.rb', line 16

def file
  return nil unless file_index
  file_collection.path(file_index)
end

#file=(path) ⇒ Object



12
13
14
# File 'lib/puppet/file_collection/lookup.rb', line 12

def file=(path)
  @file_index = file_collection.index(path)
end

#file_collectionObject



8
9
10
# File 'lib/puppet/file_collection/lookup.rb', line 8

def file_collection
  Puppet::FileCollection.collection
end