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.



3
4
5
# File 'lib/relevance/tarantula/log_grabber.rb', line 3

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



2
3
4
# File 'lib/relevance/tarantula/log_grabber.rb', line 2

def path
  @path
end

Instance Method Details

#clear!Object



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

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

#grab!Object



11
12
13
14
15
# File 'lib/relevance/tarantula/log_grabber.rb', line 11

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