module Rob::Oulette

Constants

VERSION

Public Class Methods

image(which=nil) click to toggle source
# File lib/rob/oulette.rb, line 5
def self.image(which=nil)
  title = which || titles[rand(0..titles.count - 1)]
  image = images[title]

  raise "#{which} is invalid in #{titles}" unless image

  Image.new title, bytes_for(image)
end
titles() click to toggle source
# File lib/rob/oulette.rb, line 14
def self.titles
  images.keys
end

Private Class Methods

bytes_for(image) click to toggle source
# File lib/rob/oulette.rb, line 41
def bytes_for(image)
  File.binread(File.join(File.dirname(__FILE__), 'images', image))
end
images() click to toggle source
# File lib/rob/oulette.rb, line 19
def images
  {
    gazing: '01.jpg',
    shiek: '02.jpg',
    hogan: '03.jpg',
    zombie: '04.jpg',
    fat_field: '05.jpg',
    tyson: '06.jpg',
    belly: '07.jpg',
    unimpressed: '08.jpg',
    mug: '09.jpg',
    fish_sticks: '10.jpg',
    hawk: '11.jpg',
    blank: '12.jpg',
    side_stare: '13.jpg',
    the_zone: '14.jpg',
    king_crack: '15.jpg',
    milk_mustache: '16.jpg',
    bulging: '17.jpg'
  }
end