Sha256: 5cbf5aacf679ac00e98c92deef759713920eac974f364303a68de2ee06e20027
Contents?: true
Size: 618 Bytes
Versions: 25
Compression:
Stored size: 618 Bytes
Contents
module JsonApiClient module Helpers module Initializable extend ActiveSupport::Concern included do class_attribute :initializers self.initializers = [] end module ClassMethods def initializer(method = nil, &block) self.initializers.push(method || block) end end def initialize(params = {}) initializers.each do |initializer| if initializer.respond_to?(:call) initializer.call(self, params) else self.send(initializer, params) end end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems