Sha256: 50130902f4e4493a68315c8c461f8abec0b31684a44716bddacb4b5cb307c341
Contents?: true
Size: 1.06 KB
Versions: 28
Compression:
Stored size: 1.06 KB
Contents
module Ecoportal module API module Common module GraphQL module ClassHelpers module InstanceMethods def becomes(klass) klass.new.tap do |becoming| instance_variables.each do |var| becoming.instance_variable_set(var, instance_variable_get(var)) end end end def becomes_parent_class becomes(self.class.superclass) end end module ClassMethods include Ecoportal::API::Common::Content::ClassHelpers def const?(value) begin const_get(value) rescue NameError => e return false end true end end class << self def included(base) base.send(:include, InstanceMethods) base.extend(ClassMethods) end end end end end end end
Version data entries
28 entries across 28 versions & 1 rubygems