Sha256: f860de9eb4a2171455ff87c08bbcda6de9f7252f4c8df63185205475f9ffb848
Contents?: true
Size: 775 Bytes
Versions: 22
Compression:
Stored size: 775 Bytes
Contents
# Similar to ActiveSupport.class_attribute but with a setter that doesn't use the #{name}= syntax # This preserves backward compatibility with the API in ActiveTriples require "active_support/core_ext/module/remove_method" module ActiveFedora module InheritableAccessors extend ActiveSupport::Concern module ClassMethods def define_inheritable_accessor(*names) names.each do |name| define_accessor(name, nil) end end private def define_accessor(name, val) singleton_class.class_eval do remove_possible_method(name) define_method(name) do |uri = nil| define_accessor(name, uri) if uri val end end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems