Class: SwitchFile::SourcePath

Inherits:
Valuable
  • Object
show all
Defined in:
lib/switch_file/source_path.rb

Overview

Path to a source file

Instance Method Summary collapse

Instance Method Details

#class_nameObject



6
7
8
# File 'lib/switch_file/source_path.rb', line 6

def class_name
  value.match(file_type.path_regex)[1]
end

#file_typeObject



10
11
12
# File 'lib/switch_file/source_path.rb', line 10

def file_type
  FileType.all.detect{|file_type| value =~ file_type.path_regex }
end