Class: Namesies::Reporter
- Inherits:
-
Object
- Object
- Namesies::Reporter
- Defined in:
- lib/namesies/reporter.rb
Instance Attribute Summary collapse
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title) ⇒ Reporter
constructor
A new instance of Reporter.
- #recommendation(rec) ⇒ Object
- #result(result, color = nil) ⇒ Object
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
#title ⇒ Object
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 |