227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
|
# File 'lib/spqr/manageable.rb', line 227
def self.included(other)
class << other
include ManageableClassMixins
end
unless other.respond_to? :find_by_id
def other.find_by_id(id)
raise "#{self} must define find_by_id(id)"
end
end
unless other.respond_to? :find_all
def other.find_all
raise "#{self} must define find_all"
end
end
unless other.respond_to? :class_id
def other.class_id
package_list = spqr_meta.package.to_s.split(".")
cls = spqr_meta.classname.to_s or self.name.to_s
((package_list.map {|pkg| pkg.capitalize} << cls).join("::")).hash & 0x7fffffff
end
end
name_components = other.name.to_s.split("::")
other.qmf_class_name name_components.pop
other.qmf_package_name name_components.join(".").downcase
end
|