Module: ANSI::Mixin

### Home Classes Methods

### In Files

- lib/ansi/mixin.rb

### Methods

- #black
- #black_on_blue
- #black_on_cyan
- #black_on_green
- #black_on_magenta
- #black_on_red
- #black_on_white
- #black_on_yellow
- #blink
- #blue
- #blue_on_black
- #blue_on_cyan
- #blue_on_green
- #blue_on_magenta
- #blue_on_red
- #blue_on_white
- #blue_on_yellow
- #bold
- #concealed
- #cyan
- #cyan_on_black
- #cyan_on_blue
- #cyan_on_green
- #cyan_on_magenta
- #cyan_on_red
- #cyan_on_white
- #cyan_on_yellow
- #dark
- #display
- #green
- #green_on_black
- #green_on_blue
- #green_on_cyan
- #green_on_magenta
- #green_on_red
- #green_on_white
- #green_on_yellow
- #italic
- #magenta
- #magenta_on_black
- #magenta_on_blue
- #magenta_on_cyan
- #magenta_on_green
- #magenta_on_red
- #magenta_on_white
- #magenta_on_yellow
- #negative
- #on_black
- #on_blue
- #on_cyan
- #on_green
- #on_magenta
- #on_red
- #on_white
- #on_yellow
- #rapid
- #red
- #red_on_black
- #red_on_blue
- #red_on_cyan
- #red_on_green
- #red_on_magenta
- #red_on_white
- #red_on_yellow
- #reverse
- #strike
- #underline
- #underscore
- #white
- #white_on_black
- #white_on_blue
- #white_on_cyan
- #white_on_green
- #white_on_magenta
- #white_on_red
- #white_on_yellow
- #yellow
- #yellow_on_black
- #yellow_on_blue
- #yellow_on_cyan
- #yellow_on_green
- #yellow_on_magenta
- #yellow_on_red
- #yellow_on_white

### Files

- COPYING.rdoc
- DEMO.rdoc
- HISTORY.rdoc
- README.rdoc

### Class/Module Index

Quicksearch

- ANSI
- ANSI::BBCode
- ANSI::Chain
- ANSI::Code
- ANSI::Columns
- ANSI::Constants
- ANSI::Diff
- ANSI::HexDump
- ANSI::Logger
- ANSI::Mixin
- ANSI::ProgressBar
- ANSI::String
- ANSI::Table
- ANSI::Terminal
- Object
- String

No matching classes.

# ANSI::Mixin

This module is designed specifically for mixing into String-like classes or extending String-like objects.

Generally speaking the String#ansi method is the more elegant approach to modifying a string with codes via a method call. But in some cases this Mixin's design might be preferable. Indeed, it original intent was as a compatability layer for the `colored` gem.

### Public Instance Methods

black() click to toggle source

    # File lib/ansi/mixin.rb, line 27
    def black      ; ANSI::Code.black      { to_s } ; end

black_on_blue() click to toggle source

    # File lib/ansi/mixin.rb, line 48
    def black_on_blue     ; ANSI::Code.black_on_blue     { to_s } ; end

black_on_cyan() click to toggle source

    # File lib/ansi/mixin.rb, line 50
    def black_on_cyan     ; ANSI::Code.black_on_cyan     { to_s } ; end

black_on_green() click to toggle source

    # File lib/ansi/mixin.rb, line 46
    def black_on_green    ; ANSI::Code.black_on_green    { to_s } ; end

black_on_magenta() click to toggle source

    # File lib/ansi/mixin.rb, line 49
    def black_on_magenta  ; ANSI::Code.black_on_magenta  { to_s } ; end

black_on_red() click to toggle source

    # File lib/ansi/mixin.rb, line 45
    def black_on_red      ; ANSI::Code.black_on_red      { to_s } ; end

black_on_white() click to toggle source

    # File lib/ansi/mixin.rb, line 51
    def black_on_white    ; ANSI::Code.black_on_white    { to_s } ; end

black_on_yellow() click to toggle source

    # File lib/ansi/mixin.rb, line 47
    def black_on_yellow   ; ANSI::Code.black_on_yellow   { to_s } ; end

blink() click to toggle source

    # File lib/ansi/mixin.rb, line 20
    def blink      ; ANSI::Code.blink      { to_s } ; end

blue() click to toggle source

    # File lib/ansi/mixin.rb, line 31
    def blue       ; ANSI::Code.blue       { to_s } ; end

blue_on_black() click to toggle source

    # File lib/ansi/mixin.rb, line 77
    def blue_on_black     ; ANSI::Code.blue_on_black     { to_s } ; end

blue_on_cyan() click to toggle source

    # File lib/ansi/mixin.rb, line 82
    def blue_on_cyan      ; ANSI::Code.blue_on_cyan      { to_s } ; end

blue_on_green() click to toggle source

    # File lib/ansi/mixin.rb, line 79
    def blue_on_green     ; ANSI::Code.blue_on_green     { to_s } ; end

blue_on_magenta() click to toggle source

    # File lib/ansi/mixin.rb, line 81
    def blue_on_magenta   ; ANSI::Code.blue_on_magenta   { to_s } ; end

blue_on_red() click to toggle source

    # File lib/ansi/mixin.rb, line 78
    def blue_on_red       ; ANSI::Code.blue_on_red       { to_s } ; end

blue_on_white() click to toggle source

    # File lib/ansi/mixin.rb, line 83
    def blue_on_white     ; ANSI::Code.blue_on_white     { to_s } ; end

blue_on_yellow() click to toggle source

    # File lib/ansi/mixin.rb, line 80
    def blue_on_yellow    ; ANSI::Code.blue_on_yellow    { to_s } ; end

bold() click to toggle source

    # File lib/ansi/mixin.rb, line 15
    def bold       ; ANSI::Code.bold       { to_s } ; end

concealed() click to toggle source

    # File lib/ansi/mixin.rb, line 24
    def concealed  ; ANSI::Code.concealed  { to_s } ; end

cyan() click to toggle source

    # File lib/ansi/mixin.rb, line 33
    def cyan       ; ANSI::Code.cyan       { to_s } ; end

cyan_on_black() click to toggle source

    # File lib/ansi/mixin.rb, line 93
    def cyan_on_black     ; ANSI::Code.cyan_on_black     { to_s } ; end

cyan_on_blue() click to toggle source

    # File lib/ansi/mixin.rb, line 97
    def cyan_on_blue      ; ANSI::Code.cyan_on_blue      { to_s } ; end

cyan_on_green() click to toggle source

    # File lib/ansi/mixin.rb, line 95
    def cyan_on_green     ; ANSI::Code.cyan_on_green     { to_s } ; end

cyan_on_magenta() click to toggle source

    # File lib/ansi/mixin.rb, line 98
    def cyan_on_magenta   ; ANSI::Code.cyan_on_magenta   { to_s } ; end

cyan_on_red() click to toggle source

    # File lib/ansi/mixin.rb, line 94
    def cyan_on_red       ; ANSI::Code.cyan_on_red       { to_s } ; end

cyan_on_white() click to toggle source

    # File lib/ansi/mixin.rb, line 99
    def cyan_on_white     ; ANSI::Code.cyan_on_white     { to_s } ; end

cyan_on_yellow() click to toggle source

    # File lib/ansi/mixin.rb, line 96
    def cyan_on_yellow    ; ANSI::Code.cyan_on_yellow    { to_s } ; end

dark() click to toggle source

    # File lib/ansi/mixin.rb, line 16
    def dark       ; ANSI::Code.dark       { to_s } ; end

display(line, column=0) click to toggle source

Move cursor to line and column, insert `self.to_s` and return to original positon.

    # File lib/ansi/mixin.rb, line 111
    def display(line, column=0)
      result = "\e[s"
      result << "\e[#{line.to_i};#{column.to_i}H"
      result << to_s
      result << "\e[u"
      result
    end

green() click to toggle source

    # File lib/ansi/mixin.rb, line 29
    def green      ; ANSI::Code.green      { to_s } ; end

green_on_black() click to toggle source

    # File lib/ansi/mixin.rb, line 61
    def green_on_black    ; ANSI::Code.green_on_black    { to_s } ; end

green_on_blue() click to toggle source

    # File lib/ansi/mixin.rb, line 64
    def green_on_blue     ; ANSI::Code.green_on_blue     { to_s } ; end

green_on_cyan() click to toggle source

    # File lib/ansi/mixin.rb, line 66
    def green_on_cyan     ; ANSI::Code.green_on_cyan     { to_s } ; end

green_on_magenta() click to toggle source

    # File lib/ansi/mixin.rb, line 65
    def green_on_magenta  ; ANSI::Code.green_on_magenta  { to_s } ; end

green_on_red() click to toggle source

    # File lib/ansi/mixin.rb, line 62
    def green_on_red      ; ANSI::Code.green_on_red      { to_s } ; end

green_on_white() click to toggle source

    # File lib/ansi/mixin.rb, line 67
    def green_on_white    ; ANSI::Code.green_on_white    { to_s } ; end

green_on_yellow() click to toggle source

    # File lib/ansi/mixin.rb, line 63
    def green_on_yellow   ; ANSI::Code.green_on_yellow   { to_s } ; end

italic() click to toggle source

    # File lib/ansi/mixin.rb, line 17
    def italic     ; ANSI::Code.italic     { to_s } ; end

magenta() click to toggle source

    # File lib/ansi/mixin.rb, line 32
    def magenta    ; ANSI::Code.magenta    { to_s } ; end

magenta_on_black() click to toggle source

    # File lib/ansi/mixin.rb, line 85
    def magenta_on_black  ; ANSI::Code.magenta_on_black  { to_s } ; end

magenta_on_blue() click to toggle source

    # File lib/ansi/mixin.rb, line 89
    def magenta_on_blue   ; ANSI::Code.magenta_on_blue   { to_s } ; end

magenta_on_cyan() click to toggle source

    # File lib/ansi/mixin.rb, line 90
    def magenta_on_cyan   ; ANSI::Code.magenta_on_cyan   { to_s } ; end

magenta_on_green() click to toggle source

    # File lib/ansi/mixin.rb, line 87
    def magenta_on_green  ; ANSI::Code.magenta_on_green  { to_s } ; end

magenta_on_red() click to toggle source

    # File lib/ansi/mixin.rb, line 86
    def magenta_on_red    ; ANSI::Code.magenta_on_red    { to_s } ; end

magenta_on_white() click to toggle source

    # File lib/ansi/mixin.rb, line 91
    def magenta_on_white  ; ANSI::Code.magenta_on_white  { to_s } ; end

magenta_on_yellow() click to toggle source

    # File lib/ansi/mixin.rb, line 88
    def magenta_on_yellow ; ANSI::Code.magenta_on_yellow { to_s } ; end

negative() click to toggle source

    # File lib/ansi/mixin.rb, line 23
    def negative   ; ANSI::Code.negative   { to_s } ; end

on_black() click to toggle source

    # File lib/ansi/mixin.rb, line 36
    def on_black   ; ANSI::Code.on_black   { to_s } ; end

on_blue() click to toggle source

    # File lib/ansi/mixin.rb, line 40
    def on_blue    ; ANSI::Code.on_blue    { to_s } ; end

on_cyan() click to toggle source

    # File lib/ansi/mixin.rb, line 42
    def on_cyan    ; ANSI::Code.on_cyan    { to_s } ; end

on_green() click to toggle source

    # File lib/ansi/mixin.rb, line 38
    def on_green   ; ANSI::Code.on_green   { to_s } ; end

on_magenta() click to toggle source

    # File lib/ansi/mixin.rb, line 41
    def on_magenta ; ANSI::Code.on_magenta { to_s } ; end

on_red() click to toggle source

    # File lib/ansi/mixin.rb, line 37
    def on_red     ; ANSI::Code.on_red     { to_s } ; end

on_white() click to toggle source

    # File lib/ansi/mixin.rb, line 43
    def on_white   ; ANSI::Code.on_white   { to_s } ; end

on_yellow() click to toggle source

    # File lib/ansi/mixin.rb, line 39
    def on_yellow  ; ANSI::Code.on_yellow  { to_s } ; end

rapid() click to toggle source

    # File lib/ansi/mixin.rb, line 21
    def rapid      ; ANSI::Code.rapid      { to_s } ; end

red() click to toggle source

    # File lib/ansi/mixin.rb, line 28
    def red        ; ANSI::Code.red        { to_s } ; end

red_on_black() click to toggle source

    # File lib/ansi/mixin.rb, line 53
    def red_on_black      ; ANSI::Code.red_on_black      { to_s } ; end

red_on_blue() click to toggle source

    # File lib/ansi/mixin.rb, line 56
    def red_on_blue       ; ANSI::Code.red_on_blue       { to_s } ; end

red_on_cyan() click to toggle source

    # File lib/ansi/mixin.rb, line 58
    def red_on_cyan       ; ANSI::Code.red_on_cyan       { to_s } ; end

red_on_green() click to toggle source

    # File lib/ansi/mixin.rb, line 54
    def red_on_green      ; ANSI::Code.red_on_green      { to_s } ; end

red_on_magenta() click to toggle source

    # File lib/ansi/mixin.rb, line 57
    def red_on_magenta    ; ANSI::Code.red_on_magenta    { to_s } ; end

red_on_white() click to toggle source

    # File lib/ansi/mixin.rb, line 59
    def red_on_white      ; ANSI::Code.red_on_white      { to_s } ; end

red_on_yellow() click to toggle source

    # File lib/ansi/mixin.rb, line 55
    def red_on_yellow     ; ANSI::Code.red_on_yellow     { to_s } ; end

reverse() click to toggle source

    # File lib/ansi/mixin.rb, line 22
    def reverse    ; ANSI::Code.reverse    { to_s } ; end

strike() click to toggle source

    # File lib/ansi/mixin.rb, line 25
    def strike     ; ANSI::Code.strike     { to_s } ; end

underline() click to toggle source

    # File lib/ansi/mixin.rb, line 18
    def underline  ; ANSI::Code.underline  { to_s } ; end

underscore() click to toggle source

    # File lib/ansi/mixin.rb, line 19
    def underscore ; ANSI::Code.underscore { to_s } ; end

white() click to toggle source

    # File lib/ansi/mixin.rb, line 34
    def white      ; ANSI::Code.white      { to_s } ; end

white_on_black() click to toggle source

    # File lib/ansi/mixin.rb, line 101
    def white_on_black    ; ANSI::Code.white_on_black    { to_s } ; end

white_on_blue() click to toggle source

    # File lib/ansi/mixin.rb, line 105
    def white_on_blue     ; ANSI::Code.white_on_blue     { to_s } ; end

white_on_cyan() click to toggle source

    # File lib/ansi/mixin.rb, line 107
    def white_on_cyan     ; ANSI::Code.white_on_cyan     { to_s } ; end

white_on_green() click to toggle source

    # File lib/ansi/mixin.rb, line 103
    def white_on_green    ; ANSI::Code.white_on_green    { to_s } ; end

white_on_magenta() click to toggle source

    # File lib/ansi/mixin.rb, line 106
    def white_on_magenta  ; ANSI::Code.white_on_magenta  { to_s } ; end

white_on_red() click to toggle source

    # File lib/ansi/mixin.rb, line 102
    def white_on_red      ; ANSI::Code.white_on_red      { to_s } ; end

white_on_yellow() click to toggle source

    # File lib/ansi/mixin.rb, line 104
    def white_on_yellow   ; ANSI::Code.white_on_yellow   { to_s } ; end

yellow() click to toggle source

    # File lib/ansi/mixin.rb, line 30
    def yellow     ; ANSI::Code.yellow     { to_s } ; end

yellow_on_black() click to toggle source

    # File lib/ansi/mixin.rb, line 69
    def yellow_on_black   ; ANSI::Code.yellow_on_black   { to_s } ; end

yellow_on_blue() click to toggle source

    # File lib/ansi/mixin.rb, line 72
    def yellow_on_blue    ; ANSI::Code.yellow_on_blue    { to_s } ; end

yellow_on_cyan() click to toggle source

    # File lib/ansi/mixin.rb, line 74
    def yellow_on_cyan    ; ANSI::Code.yellow_on_cyan    { to_s } ; end

yellow_on_green() click to toggle source

    # File lib/ansi/mixin.rb, line 71
    def yellow_on_green   ; ANSI::Code.yellow_on_green   { to_s } ; end

yellow_on_magenta() click to toggle source

    # File lib/ansi/mixin.rb, line 73
    def yellow_on_magenta ; ANSI::Code.yellow_on_magenta { to_s } ; end

yellow_on_red() click to toggle source

    # File lib/ansi/mixin.rb, line 70
    def yellow_on_red     ; ANSI::Code.yellow_on_red     { to_s } ; end

yellow_on_white() click to toggle source

    # File lib/ansi/mixin.rb, line 75
    def yellow_on_white   ; ANSI::Code.yellow_on_white   { to_s } ; end

[Validate]

Generated with the Darkfish Rdoc Generator 2.