Sha256: c0b7af896f673bac3dba631385a2b0c367400e292dcd020568afa6484aae867c
Contents?: true
Size: 567 Bytes
Versions: 15
Compression:
Stored size: 567 Bytes
Contents
# frozen_string_literal: true module RailsMiniProfiler class BasePresenter < SimpleDelegator def initialize(model, view, **_kwargs) @h = view super(model) end attr_reader :h alias model __getobj__ # To avoid having to address the view context explicitly we try to delegate to it def method_missing(method, *args, &block) h.public_send(method, *args, &block) rescue NoMethodError super end def respond_to_missing?(method_name, *args) h.respond_to?(method_name, *args) || super end end end
Version data entries
15 entries across 15 versions & 1 rubygems