Class: Exercise::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/exercise/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(full_path, project_root) ⇒ Path

Returns a new instance of Path.



28
29
30
31
# File 'lib/commands/exercise/command.rb', line 28

def initialize(full_path, project_root)
  @full = full_path
  @project_root = project_root
end

Instance Attribute Details

#fullObject (readonly)

Returns the value of attribute full.



26
27
28
# File 'lib/commands/exercise/command.rb', line 26

def full
  @full
end

Instance Method Details

#relativeObject



33
34
35
# File 'lib/commands/exercise/command.rb', line 33

def relative
  ".#{File.expand_path(full).gsub(File.expand_path(project_root), '')}"
end