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 23 24 25 |
# File 'lib/espnscrape/util.rb', line 13 def self.a2_to_table(args, row_width=30) spc = row_width puts "" args.each do |row| row.each do |td| print td if((spc - td.to_s.length) > 0) print " "*(spc - td.to_s.length) end 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
30 31 32 33 34 35 36 |
# File 'lib/espnscrape/util.rb', line 30 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 |