Class: Util
- Inherits:
-
Object
- Object
- Util
- Defined in:
- lib/espnscrape/util.rb
Overview
Debug Utilities
Class Method Summary collapse
-
.a2_to_table(args, row_width = 30) ⇒ Object
Print two dimensional array as a string.
-
.a_to_s(*args) ⇒ String
Print an array as a string.
-
.printTotals(teamTotals) ⇒ String
NbaBoxScore: Print totals row.
Class Method Details
.a2_to_table(args, row_width = 30) ⇒ Object
Print two dimensional array as a string
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/espnscrape/util.rb', line 13 def self.a2_to_table(args, row_width=30) spc = row_width args.each do |row| row.each do |td| print td print " "*(spc - td.to_s.length) end puts end end |
.a_to_s(*args) ⇒ String
Print an array as a string
6 7 8 |
# File 'lib/espnscrape/util.rb', line 6 def self.a_to_s(*args) return args.join(', ') end |
.printTotals(teamTotals) ⇒ String
NbaBoxScore: Print totals row
27 28 29 30 31 32 33 |
# File 'lib/espnscrape/util.rb', line 27 def self.printTotals(teamTotals) print "Totals:\t\t\t\t\t\t\t\t\t\t" teamTotals.each do |cell| print "\t\t" + cell + "\t|| " end puts "\n\n" end |