Class: Potty::Style

Inherits:
Struct
  • Object
show all
Defined in:
lib/potty/style.rb

Overview

A semantic, render-target-agnostic description of how to draw text: symbolic colours (:cyan, :default, :bright_black, …) plus attributes. A Surface resolves a Style to concrete output — curses attributes on a CursesSurface, ANSI SGR codes on an InlineSurface — so the same widget renders to either target unchanged.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bgObject

Returns the value of attribute bg

Returns:

  • (Object)

    the current value of bg



9
10
11
# File 'lib/potty/style.rb', line 9

def bg
  @bg
end

#boldObject

Returns the value of attribute bold

Returns:

  • (Object)

    the current value of bold



9
10
11
# File 'lib/potty/style.rb', line 9

def bold
  @bold
end

#fgObject

Returns the value of attribute fg

Returns:

  • (Object)

    the current value of fg



9
10
11
# File 'lib/potty/style.rb', line 9

def fg
  @fg
end

#reverseObject

Returns the value of attribute reverse

Returns:

  • (Object)

    the current value of reverse



9
10
11
# File 'lib/potty/style.rb', line 9

def reverse
  @reverse
end

#underlineObject

Returns the value of attribute underline

Returns:

  • (Object)

    the current value of underline



9
10
11
# File 'lib/potty/style.rb', line 9

def underline
  @underline
end

Instance Method Details

#bold?Boolean

Returns:

  • (Boolean)


10
# File 'lib/potty/style.rb', line 10

def bold?      = !!bold

#reverse?Boolean

Returns:

  • (Boolean)


12
# File 'lib/potty/style.rb', line 12

def reverse?   = !!reverse

#underline?Boolean

Returns:

  • (Boolean)


11
# File 'lib/potty/style.rb', line 11

def underline? = !!underline