Class: RuboCop::Git::PseudoResource
- Inherits:
-
Object
- Object
- RuboCop::Git::PseudoResource
- Defined in:
- lib/rubocop/git/pseudo_resource.rb
Instance Attribute Summary collapse
-
#file_relative_path ⇒ Object
(also: #filename)
readonly
Returns the value of attribute file_relative_path.
-
#patch ⇒ Object
readonly
Returns the value of attribute patch.
-
#pwd ⇒ Object
readonly
Returns the value of attribute pwd.
Instance Method Summary collapse
- #absolute_path ⇒ Object
-
#initialize(file_relative_path, pwd = Dir.pwd) ⇒ PseudoResource
constructor
A new instance of PseudoResource.
- #status ⇒ Object
Constructor Details
#initialize(file_relative_path, pwd = Dir.pwd) ⇒ PseudoResource
Returns a new instance of PseudoResource.
6 7 8 9 10 |
# File 'lib/rubocop/git/pseudo_resource.rb', line 6 def initialize(file_relative_path, pwd = Dir.pwd) @file_relative_path = file_relative_path @pwd = pwd @patch = '' end |
Instance Attribute Details
#file_relative_path ⇒ Object (readonly) Also known as: filename
Returns the value of attribute file_relative_path.
2 3 4 |
# File 'lib/rubocop/git/pseudo_resource.rb', line 2 def file_relative_path @file_relative_path end |
#patch ⇒ Object (readonly)
Returns the value of attribute patch.
2 3 4 |
# File 'lib/rubocop/git/pseudo_resource.rb', line 2 def patch @patch end |
#pwd ⇒ Object (readonly)
Returns the value of attribute pwd.
2 3 4 |
# File 'lib/rubocop/git/pseudo_resource.rb', line 2 def pwd @pwd end |
Instance Method Details
#absolute_path ⇒ Object
12 13 14 15 |
# File 'lib/rubocop/git/pseudo_resource.rb', line 12 def absolute_path filename File.join(pwd, filename) end |
#status ⇒ Object
17 18 19 |
# File 'lib/rubocop/git/pseudo_resource.rb', line 17 def status 'modified' end |