Sha256: e16777bc1c0119576611e698e06386d04125e19d54f18fd6c89626c3d28d8018
Contents?: true
Size: 679 Bytes
Versions: 35
Compression:
Stored size: 679 Bytes
Contents
module PushType module Templatable extend ActiveSupport::Concern def template self.class.template_path end def template_args [template, self.class.template_opts.except!(:path)] end module ClassMethods def template(name, opts = {}) @template_name = name.to_s @template_opts = opts end def template_name @template_name || self.name.underscore end def template_path File.join template_opts[:path], template_name end def template_opts { path: _ct.base_class.name.demodulize.pluralize.underscore }.merge(@template_opts || {}) end end end end
Version data entries
35 entries across 35 versions & 1 rubygems