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.



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_pathObject (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

#patchObject (readonly)

Returns the value of attribute patch.



2
3
4
# File 'lib/rubocop/git/pseudo_resource.rb', line 2

def patch
  @patch
end

#pwdObject (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_pathObject



12
13
14
15
# File 'lib/rubocop/git/pseudo_resource.rb', line 12

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

#statusObject



17
18
19
# File 'lib/rubocop/git/pseudo_resource.rb', line 17

def status
  'modified'
end