Sha256: 3bd67400e7a187bed38d73d5b26d374f2f9fc41bb74baab29cdd6a1e81d9e6d6
Contents?: true
Size: 627 Bytes
Versions: 6
Compression:
Stored size: 627 Bytes
Contents
# frozen_string_literal: true require 'delegate' module Lite module Decorator class Base < SimpleDelegator class << self def decorate(object) return new(object) unless object.respond_to?(:each) object.map { |obj| new(obj) } end end def class if object.class.respond_to?(:table_name) object.class else super end end def object __getobj__ end def to_model if object.respond_to?(:to_model) super else object end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems