Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created February 14, 2014 18:27
Show Gist options
  • Save practicingruby/9006286 to your computer and use it in GitHub Desktop.
Save practicingruby/9006286 to your computer and use it in GitHub Desktop.
class Proxy
def initialize(document, style)
@document = document
@style = style
end
def text(string, params)
params[:size] ||= @style[:font_size]
params[:color] ||= @style[:font_color]
@document.text(string, params)
end
end
doc = Proxy.new(Prawn::Document.new, :font_size => 12, :font_color => "ff00ff")
doc.text("Hello World!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment