Class: Milktea::Text

Inherits:
Container show all
Defined in:
lib/milktea/text.rb

Overview

Text component for displaying text content with wrapping and truncation

Instance Attribute Summary

Attributes inherited from Container

#bounds

Attributes inherited from Model

#children, #state

Instance Method Summary collapse

Methods inherited from Container

child, direction, flex_direction, #initialize

Methods inherited from Model

child, children, #children_views, #initialize, #screen_height, #screen_size, #screen_width, #update, #with

Constructor Details

This class inherits a constructor from Milktea::Container

Instance Method Details

#viewObject



9
10
11
12
13
14
# File 'lib/milktea/text.rb', line 9

def view
  return "" if content.empty?
  return render(truncated_lines) if state[:wrap]

  render_truncated
end