Class: Git::Path
- Inherits:
-
Object
- Object
- Git::Path
- Defined in:
- lib/git/path.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, check_path = true) ⇒ Path
constructor
A new instance of Path.
- #readable? ⇒ Boolean
- #writable? ⇒ Boolean
Constructor Details
#initialize(path, check_path = true) ⇒ Path
Returns a new instance of Path.
6 7 8 9 10 11 12 |
# File 'lib/git/path.rb', line 6 def initialize(path, check_path = true) if !check_path || File.exists?(path) @path = File.(path) else raise ArgumentError, "path does not exist", File.(path) end end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/git/path.rb', line 4 def path @path end |
Instance Method Details
#readable? ⇒ Boolean
14 15 16 |
# File 'lib/git/path.rb', line 14 def readable? File.readable?(@path) end |
#writable? ⇒ Boolean
18 19 20 |
# File 'lib/git/path.rb', line 18 def writable? File.writable?(@path) end |