Class: Namesies::Reporter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title) ⇒ Reporter

Returns a new instance of Reporter.



7
8
9
# File 'lib/namesies/reporter.rb', line 7

def initialize(title)
  @title = title
end

Instance Attribute Details

#titleObject

Returns the value of attribute title.



5
6
7
# File 'lib/namesies/reporter.rb', line 5

def title
  @title
end

Instance Method Details

#recommendation(rec) ⇒ Object



23
24
25
# File 'lib/namesies/reporter.rb', line 23

def recommendation(rec)
  puts "     " + rec
end

#result(result, color = nil) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/namesies/reporter.rb', line 11

def result(result, color = nil)
  out = "  #{@title}: "

  if color
    out += result.send(color)
  else
    out += result
  end

  puts out
end