Skip to content

Instantly share code, notes, and snippets.

@RaphaelAudet
Created March 12, 2012 01:20
Show Gist options
  • Save RaphaelAudet/2019147 to your computer and use it in GitHub Desktop.
Save RaphaelAudet/2019147 to your computer and use it in GitHub Desktop.
base_presenter.rb
class BasePresenter
def initialize(object, template)
@object = object
@template = template
end
private
def self.presents(name)
define_method(name) do
@object
end
end
def h
@template
end
def method_missing(*args, &block)
@template.send(*args, &block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment