Class: TTY::Pager::NullPager

Inherits:
Abstract show all
Defined in:
lib/tty/pager/null.rb

Constant Summary

Constants inherited from Abstract

Abstract::UndefinedMethodError

Instance Method Summary collapse

Methods inherited from Abstract

#enabled?, #initialize, page, #page, #try_write

Constructor Details

This class inherits a constructor from TTY::Pager::Abstract

Instance Method Details

#closeObject

Do nothing, always return success



30
31
32
# File 'lib/tty/pager/null.rb', line 30

def close
  true
end

#puts(text) ⇒ Object

Pass output directly to stdout



21
22
23
24
25
# File 'lib/tty/pager/null.rb', line 21

def puts(text)
  return text unless output.tty?

  output.puts(text)
end

#write(text) ⇒ Object Also known as: <<

Pass output directly to stdout



11
12
13
14
15
# File 'lib/tty/pager/null.rb', line 11

def write(text)
  return text unless output.tty?

  output.write(text)
end