Class: LearnDoctor::HealthCheck::File

Inherits:
Object
  • Object
show all
Defined in:
lib/learn_doctor/health_check/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(step, check_or_install) ⇒ File

Returns a new instance of File.



7
8
9
10
11
12
13
14
15
# File 'lib/learn_doctor/health_check/file.rb', line 7

def initialize(step, check_or_install)
  @step             = step
  @check_or_install = check_or_install
  @conn             = Faraday.new

  prepare_file!

  return self
end

Instance Attribute Details

#check_or_installObject (readonly)

Returns the value of attribute check_or_install.



4
5
6
# File 'lib/learn_doctor/health_check/file.rb', line 4

def check_or_install
  @check_or_install
end

#connObject (readonly)

Returns the value of attribute conn.



4
5
6
# File 'lib/learn_doctor/health_check/file.rb', line 4

def conn
  @conn
end

#fileObject

Returns the value of attribute file.



5
6
7
# File 'lib/learn_doctor/health_check/file.rb', line 5

def file
  @file
end

#stepObject (readonly)

Returns the value of attribute step.



4
5
6
# File 'lib/learn_doctor/health_check/file.rb', line 4

def step
  @step
end

Instance Method Details

#pathObject



21
22
23
# File 'lib/learn_doctor/health_check/file.rb', line 21

def path
  file.path
end

#unlink!Object



17
18
19
# File 'lib/learn_doctor/health_check/file.rb', line 17

def unlink!
  self.file.unlink
end