module Werd module Reports class Basic include Contracts attr_reader :words Contract ArrayOf[[String, Num]] => Any def initialize words @words = words.first(30) end Contract None => String def to_s words.map do |row| "%4i %s" % [row.last, row.first] end.join("\n") end end end end