Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/yummi/extensions.rb
Instance Method Summary collapse
-
#colorize(params) ⇒ Object
Colorizes each array item in a new String array.
-
#on_table(params = {}) ⇒ Object
Returns a #Yummi#Table using the array content as the data.
-
#uncolored ⇒ Object
Returns a new array using the items with no color applied.
Instance Method Details
#colorize(params) ⇒ Object
Colorizes each array item in a new String array
70 71 72 |
# File 'lib/yummi/extensions.rb', line 70 def colorize(params) map { |n| n.to_s.colorize params } end |
#on_table(params = {}) ⇒ Object
Returns a #Yummi#Table using the array content as the data.
The parameters will be used to instantiate the table.
86 87 88 89 90 |
# File 'lib/yummi/extensions.rb', line 86 def on_table(params = {}) table = Yummi::Table::new params table.data = self return table end |
#uncolored ⇒ Object
Returns a new array using the items with no color applied
77 78 79 |
# File 'lib/yummi/extensions.rb', line 77 def uncolored map {|n| n.to_s.uncolored} end |