Skip to content

Instantly share code, notes, and snippets.

@francirp
Created August 8, 2016 16:22
Show Gist options
  • Save francirp/4fa8b6ae4d530749dc66b55845164afb to your computer and use it in GitHub Desktop.
Save francirp/4fa8b6ae4d530749dc66b55845164afb to your computer and use it in GitHub Desktop.
Decorators Codeblock 14
class BaseDecorator < Draper::Decorator
  delegate_all

  def self.currency(*keys)
    keys.each do |key|
      define_method(key) do
      end

      define_method("display_#{key}") do
      end
    end
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment