Class: Relevance::Tarantula::LogGrabber

Inherits:
Object
  • Object
show all
Defined in:
lib/relevance/tarantula/log_grabber.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ LogGrabber

Returns a new instance of LogGrabber.



6
7
8
# File 'lib/relevance/tarantula/log_grabber.rb', line 6

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



5
6
7
# File 'lib/relevance/tarantula/log_grabber.rb', line 5

def path
  @path
end

Instance Method Details

#clear!Object



10
11
12
# File 'lib/relevance/tarantula/log_grabber.rb', line 10

def clear!
  File.open(@path, "w")
end

#grab!Object



14
15
16
17
18
# File 'lib/relevance/tarantula/log_grabber.rb', line 14

def grab!
  File.read(@path)
ensure
  clear!
end