Class: TextWidget

Inherits:
Widget show all
Defined in:
lib/widgets/text_widget.rb

Class Method Summary collapse

Class Method Details

.single_text_widget(widget) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/widgets/text_widget.rb', line 13

def self.single_text_widget(widget)
  output = single_text_header(widget.col_size, widget.color)
  output << visual(widget.icon)
  output << details(widget.data.keys.first, widget.data.values.first)
  output << view_more(widget.link) unless widget.link.nil?
  output << single_cap
  output.html_safe
end

.text_widget(widget) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/widgets/text_widget.rb', line 5

def self.text_widget(widget)
  output = header(widget.color, widget.title, widget.row_size, widget.col_size)
  output << widget_text(widget.text)
  output << text_panel(widget.data, widget.direction)
  output << cap
  output.html_safe
end