Class: Exercise::Path
- Inherits:
-
Object
- Object
- Exercise::Path
- Defined in:
- lib/commands/exercise/command.rb
Instance Attribute Summary collapse
-
#full ⇒ Object
readonly
Returns the value of attribute full.
Instance Method Summary collapse
-
#initialize(full_path, project_root) ⇒ Path
constructor
A new instance of Path.
- #relative ⇒ Object
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
#full ⇒ Object (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
#relative ⇒ Object
33 34 35 |
# File 'lib/commands/exercise/command.rb', line 33 def relative ".#{File.expand_path(full).gsub(File.expand_path(project_root), '')}" end |