gitlab-org--gitlab-foss/lib/gitlab/view/presenter/delegated.rb
Rémy Coutable bf789ff567 Improve presenter architecture
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-18 16:38:34 +01:00

19 lines
385 B
Ruby

module Gitlab
module View
module Presenter
class Delegated < SimpleDelegator
include Gitlab::View::Presenter::Base
def initialize(subject, **attributes)
@subject = subject
attributes.each do |key, value|
define_singleton_method(key) { value }
end
super(subject)
end
end
end
end
end