class Module def resource_exist? resource_name self_ancestors_and_namespaces do |klass| return true if RubyExt::Resource.resource_exist? klass, resource_name end return false end def [] resource_name self_ancestors_and_namespaces do |klass| if RubyExt::Resource.resource_exist? klass, resource_name return RubyExt::Resource.resource_get(klass, resource_name) end end raise RubyExt::Resource::NotExist, "Resource '#{resource_name}' for Class '#{self.name}' doesn't exist!", caller end def []= resource_name, value RubyExt::Resource.resource_set self.name, resource_name, value end end