Class: Werd::Reports::Basic
- Inherits:
-
Object
- Object
- Werd::Reports::Basic
- Includes:
- Contracts
- Defined in:
- lib/werd/reports/basic.rb
Instance Attribute Summary collapse
-
#words ⇒ Object
readonly
Returns the value of attribute words.
Instance Method Summary collapse
-
#initialize(words) ⇒ Basic
constructor
A new instance of Basic.
- #to_s ⇒ Object
Constructor Details
#initialize(words) ⇒ Basic
Returns a new instance of Basic.
8 9 10 |
# File 'lib/werd/reports/basic.rb', line 8 def initialize words @words = words.first(30) end |
Instance Attribute Details
#words ⇒ Object (readonly)
Returns the value of attribute words.
5 6 7 |
# File 'lib/werd/reports/basic.rb', line 5 def words @words end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 |
# File 'lib/werd/reports/basic.rb', line 13 def to_s words.map do |row| "%4i %s" % [row.last, row.first] end.join("\n") end |