Class: IOAble

Inherits:
Object
  • Object
show all
Defined in:
lib/LRH.rb

Direct Known Subclasses

Harvester, Lister, ListerJoiner, Runner

Instance Method Summary collapse

Constructor Details

#initializeIOAble

Returns a new instance of IOAble.



2
3
4
# File 'lib/LRH.rb', line 2

def initialize
    @config = {}
end

Instance Method Details

#debug!Object



14
15
16
17
18
# File 'lib/LRH.rb', line 14

def debug!
    set_option :debug, true
    
    self
end

#debug?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/LRH.rb', line 20

def debug?
    return get_option(:debug)
end

#get_option(name) ⇒ Object



10
11
12
# File 'lib/LRH.rb', line 10

def get_option(name)
    return @config[name]
end

#halt!Object



28
29
30
# File 'lib/LRH.rb', line 28

def halt!
    @job.halt! if @job
end

#job=(job) ⇒ Object



24
25
26
# File 'lib/LRH.rb', line 24

def job=(job)
    @job = job
end

#log(obj) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/LRH.rb', line 32

def log(obj)
    msg = nil
    msg = "Lister: " + obj.to_s if self.is_a? Lister
    msg = "Runner: " + obj.to_s if self.is_a? Runner
    msg = "Harvester: " + obj.to_s if self.is_a? Harvester
    
    puts msg
    return msg
end

#set_option(name, value) ⇒ Object



6
7
8
# File 'lib/LRH.rb', line 6

def set_option(name, value)
    @config[name] = value
end