Class: Vocab::UI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeUI

Returns a new instance of UI.



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

def initialize()
  @silent = false
end

Instance Attribute Details

#silentObject

Returns the value of attribute silent.



4
5
6
# File 'lib/vocab/ui.rb', line 4

def silent
  @silent
end

Instance Method Details

#say(message) ⇒ Object



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

def say( message )
  puts message unless silent
end

#warn(message) ⇒ Object



14
15
16
# File 'lib/vocab/ui.rb', line 14

def warn( message )
  say( "Warning: #{message}" )
end