Class: TansParser::Element

Inherits:
Struct
  • Object
show all
Defined in:
lib/tans_parser/element.rb

Overview

Describes a recognized UI element on the terminal screen.

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



5
6
7
# File 'lib/tans_parser/element.rb', line 5

def bg
  @bg
end

#checkedObject

Returns the value of attribute checked

Returns:

  • (Object)

    the current value of checked



5
6
7
# File 'lib/tans_parser/element.rb', line 5

def checked
  @checked
end

#colObject

Returns the value of attribute col

Returns:

  • (Object)

    the current value of col



5
6
7
# File 'lib/tans_parser/element.rb', line 5

def col
  @col
end

#fgObject

Returns the value of attribute fg

Returns:

  • (Object)

    the current value of fg



5
6
7
# File 'lib/tans_parser/element.rb', line 5

def fg
  @fg
end

#focusedObject

Returns the value of attribute focused

Returns:

  • (Object)

    the current value of focused



5
6
7
# File 'lib/tans_parser/element.rb', line 5

def focused
  @focused
end

#heightObject

Returns the value of attribute height

Returns:

  • (Object)

    the current value of height



5
6
7
# File 'lib/tans_parser/element.rb', line 5

def height
  @height
end

#roleObject

Returns the value of attribute role

Returns:

  • (Object)

    the current value of role



5
6
7
# File 'lib/tans_parser/element.rb', line 5

def role
  @role
end

#rowObject

Returns the value of attribute row

Returns:

  • (Object)

    the current value of row



5
6
7
# File 'lib/tans_parser/element.rb', line 5

def row
  @row
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



5
6
7
# File 'lib/tans_parser/element.rb', line 5

def text
  @text
end

#widthObject

Returns the value of attribute width

Returns:

  • (Object)

    the current value of width



5
6
7
# File 'lib/tans_parser/element.rb', line 5

def width
  @width
end

Instance Method Details

#to_hObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/tans_parser/element.rb', line 15

def to_h
  {
    role: role,
    text: text,
    row: row, col: col,
    width: width, height: height,
    checked: checked,
    focused: focused,
    fg: fg, bg: bg,
  }.compact
end