Sha256: 47c85aab020c02677cd515f8c1a957c9cb2e6e06e7671ae1caf8e9c655f9e5bc
Contents?: true
Size: 512 Bytes
Versions: 1
Compression:
Stored size: 512 Bytes
Contents
# frozen_string_literal: true require 'tramway/decorators/class_helper' module Tramway module Helpers # Provides methods into Rails ActionController # module DecorateHelper def tramway_decorate(object_or_array, decorator: nil) return [] if Tramway::Decorators::CollectionDecorators.collection?(object_or_array) && object_or_array.empty? Tramway::Decorators::ClassHelper.decorator_class(object_or_array, decorator).decorate object_or_array, self end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tramway-0.2.1.2 | lib/tramway/helpers/decorate_helper.rb |