class BBS::Renderer::Context
The object an ERB screen is evaluated in. Its methods are the helpers a template can call: colour codes (green, reset, …), clr, banner and big_banner.
Public Class Methods
Source
# File lib/bbs/renderer.rb, line 34 def initialize(vars) vars.each { |k, v| instance_variable_set(:"@#{k}", v) } end
Sets each pair of vars as an instance variable.
Public Instance Methods
Source
# File lib/bbs/renderer.rb, line 62 def clr = Ansi::CLEAR
Escape sequence that clears the screen and homes the cursor.
Source
# File lib/bbs/renderer.rb, line 39 def ctx_binding = binding
The Binding ERB evaluates the template in.
Source
# File lib/bbs/renderer.rb, line 70 def cyan = Ansi::BRIGHT_CYAN
Escape sequence for bright cyan text.
Source
# File lib/bbs/renderer.rb, line 78 def dim_green = Ansi::GREEN
Escape sequence for normal (dim) green text.
Source
# File lib/bbs/renderer.rb, line 74 def gray = Ansi::GREY
Escape sequence for light gray text.
Source
# File lib/bbs/renderer.rb, line 66 def green = Ansi::BRIGHT_GREEN
Escape sequence for bright green text.
Source
# File lib/bbs/renderer.rb, line 76 def red = Ansi::BRIGHT_RED
Escape sequence for bright red text.
Source
# File lib/bbs/renderer.rb, line 64 def reset = Ansi::RESET
Escape sequence that resets all colours and attributes.
Source
# File lib/bbs/renderer.rb, line 72 def white = Ansi::WHITE
Escape sequence for bright white text.
Source
# File lib/bbs/renderer.rb, line 68 def yellow = Ansi::BRIGHT_YELLOW
Escape sequence for bright yellow text.