module PictureFrame

encoding: utf-8

Constants

VERSION

Public Class Methods

create(frame_spec = nil, options = {}) click to toggle source
# File lib/picture_frame.rb, line 8
def create(frame_spec = nil, options = {})
  case frame_spec
  when String
    template = frame_spec
  when :random
    template = Predefined.random
  when Symbol
    template = Predefined.named(frame_spec)
  when nil
    template = Predefined.default
  end
  raise ArgumentError, "No such template: #{frame_spec.inspect}" unless template
  Frame.new(template, options)
end
showcase(text) click to toggle source
# File lib/picture_frame.rb, line 23
def showcase(text)
  Predefined.each do |name|
    puts name.inspect
    puts create(name).frame(text)
    puts
  end
end