Class: Inq::Text

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

Overview

Helper class for printing text, but hiding it when e.g. running in CI.

Class Method Summary collapse

Class Method Details



18
19
20
# File 'lib/inq/text.rb', line 18

def self.print(*args)
  Kernel.print(*args) if Inq::Text.show_default_output
end

.puts(*args) ⇒ Object



22
23
24
# File 'lib/inq/text.rb', line 22

def self.puts(*args)
  Kernel.puts(*args) if Inq::Text.show_default_output
end

.show_default_outputObject



7
8
9
10
11
12
# File 'lib/inq/text.rb', line 7

def self.show_default_output
  @show_default_output = true unless
    instance_variable_defined?(:"@show_default_output")

  @show_default_output
end

.show_default_output=(val) ⇒ Object



14
15
16
# File 'lib/inq/text.rb', line 14

def self.show_default_output=(val)
  @show_default_output = val
end