Skip to content

Instantly share code, notes, and snippets.

@theotherzach
Created January 23, 2014 21:24
Show Gist options
  • Save theotherzach/8587120 to your computer and use it in GitHub Desktop.
Save theotherzach/8587120 to your computer and use it in GitHub Desktop.
Context Arguments in Ruby
class ArticleTemplate
#TODO: Extract title and author into header method
#TODO: Extract body into its own method
#TODO: Don't hard-code text
def initialize
Prawn::Document.generate("tmp/production.pdf") do
text "The Prince", :align => :center, :size => 18
text "Niccolò Machiavelli", :align => :center, :size => 14
move_down 12
text "All the States and Governments ..."
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment