Skip to content

Instantly share code, notes, and snippets.

@kremso
Created February 20, 2010 11:22
Show Gist options
  • Save kremso/309633 to your computer and use it in GitHub Desktop.
Save kremso/309633 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'serenity'
class Showcase
include Serenity::Generator
Person = Struct.new(:name, :items)
Item = Struct.new(:name, :usage)
def generate_showcase
@title = 'Serenity inventory'
mals_items = [Item.new('Moses Brothers Self-Defense Engine Frontier Model B', 'Lock and load')]
mal = Person.new('Malcolm Reynolds', mals_items)
jaynes_items = [Item.new('Vera', 'Callahan full-bore auto-lock with a customized trigger, double cartridge and thorough gauge'),
Item.new('Lux', 'Ratatata'),
Item.new('Knife', 'Cut-throat')]
jayne = Person.new('Jayne Cobb', jaynes_items)
@crew = [mal, jayne]
render_odt 'showcase.odt'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment