Class: Imba::Movie
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Imba::Movie
- Includes:
- Colors
- Defined in:
- lib/imba/movie.rb
Instance Method Summary collapse
Methods included from Colors
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/imba/movie.rb', line 11 def to_s terminal_width = `tput cols` column = terminal_width.to_i / 2 ''.tap do |s| s << "#{sprintf('%-9s', uniq_id)} #{green(name)}".ljust(column) s << ' ' + magenta("(#{year})") s << ' ' + red("#{rating}/10") s << ' ' + yellow(genres) s.rjust(column) end end |