Sha256: eada78dbf86e581a5dd840cbadf659fc8e289f17bd8261b05c7b137c1bffebcb

Contents?: true

Size: 494 Bytes

Versions: 1

Compression:

Stored size: 494 Bytes

Contents

module SimpleDecorator
  module RailsHelpers
    include ActionView::Helpers::NumberHelper
    include ActionView::Helpers::TranslationHelper

    # Rails +try+ is delegated to component instead calling it on delegator itself.
    # https://github.com/rails/rails/commit/2575508a385f4a8003ea1277025c018583971e1d
    def try(*args, &block)
      if args.empty? && block_given?
        yield self
      else
        public_send *args, &block if respond_to? args.first
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unico-training-7.8.0 lib/simple_decorator/rails_helpers.rb