Class: FileFinder::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/file_finder/finder.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, calling_file) ⇒ Finder

Returns a new instance of Finder.



16
17
18
19
# File 'lib/file_finder/finder.rb', line 16

def initialize(path, calling_file)
  @path = path
  @calling_file = calling_file
end

Instance Attribute Details

#calling_fileObject (readonly)

Returns the value of attribute calling_file.



10
11
12
# File 'lib/file_finder/finder.rb', line 10

def calling_file
  @calling_file
end

#configurationObject (readonly)

Returns the value of attribute configuration.



10
11
12
# File 'lib/file_finder/finder.rb', line 10

def configuration
  @configuration
end

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/file_finder/finder.rb', line 10

def path
  @path
end

Class Method Details

.get_absolute_path_to(path, calling_file = __FILE__) ⇒ Object



12
13
14
# File 'lib/file_finder/finder.rb', line 12

def self.get_absolute_path_to(path, calling_file = __FILE__)
  new(path, calling_file).absolute_path
end

Instance Method Details

#absolute_pathObject



21
22
23
# File 'lib/file_finder/finder.rb', line 21

def absolute_path
  Pathname.new(File.join(File.dirname(File.expand_path(calling_file)), path)).expand_path.to_s
end