Class: SwitchFile::FileType

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

Overview

A type of file within the project

Instance Method Summary collapse

Instance Method Details

#generate_open_command(source) ⇒ Object



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

def generate_open_command(source)
  "#{command} #{source.project.path}/#{relative_path(source)}"
end

#relative_path(source) ⇒ Object

Path of matching file to source, relative to source’s project



15
16
17
# File 'lib/switch_file/file_type.rb', line 15

def relative_path(source)
  path_generator.call(source.class_name)
end