Class: RuboCop::Git::PseudoResource

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/git/pseudo_resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_relative_path, pwd = Dir.pwd) ⇒ PseudoResource

Returns a new instance of PseudoResource.



8
9
10
11
12
# File 'lib/rubocop/git/pseudo_resource.rb', line 8

def initialize(file_relative_path, pwd = Dir.pwd)
  @file_relative_path = file_relative_path
  @pwd = pwd
  @patch = ''
end

Instance Attribute Details

#file_relative_pathObject (readonly) Also known as: filename

Returns the value of attribute file_relative_path.



4
5
6
# File 'lib/rubocop/git/pseudo_resource.rb', line 4

def file_relative_path
  @file_relative_path
end

#patchObject (readonly)

Returns the value of attribute patch.



4
5
6
# File 'lib/rubocop/git/pseudo_resource.rb', line 4

def patch
  @patch
end

#pwdObject (readonly)

Returns the value of attribute pwd.



4
5
6
# File 'lib/rubocop/git/pseudo_resource.rb', line 4

def pwd
  @pwd
end

Instance Method Details

#absolute_pathObject



14
15
16
17
# File 'lib/rubocop/git/pseudo_resource.rb', line 14

def absolute_path
  filename
  File.join(pwd, filename)
end

#statusObject



19
20
21
# File 'lib/rubocop/git/pseudo_resource.rb', line 19

def status
  'modified'
end