Class: RailsDecorators::Base

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, ActionView::Helpers::UrlHelper
Defined in:
lib/rails_decorators/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(subject) ⇒ Base

Returns a new instance of Base.



7
8
9
10
11
12
13
14
15
# File 'lib/rails_decorators/base.rb', line 7

def initialize(subject)
  subject.public_methods.each do |method|
    (class << self; self; end).class_eval do
      define_method method do |*args|
        subject.send method, *args
      end
    end
  end  
end