Class: Machinery::Ui::Hint

Inherits:
Object show all
Defined in:
lib/hint.rb

Class Method Summary collapse

Class Method Details



22
23
24
25
26
# File 'lib/hint.rb', line 22

def print(method, options = {})
  return unless Machinery::Config.new.hints

  Machinery::Ui.puts to_string(method, options)
end

.program_nameObject



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

def program_name
  if which_machinery == $PROGRAM_NAME
    "machinery"
  else
    $PROGRAM_NAME
  end
end

.to_string(method, options = {}) ⇒ Object



28
29
30
31
32
# File 'lib/hint.rb', line 28

def to_string(method, options = {})
  return "" unless Machinery::Config.new.hints

  "\nHint: #{send(method, options)}\n"
end