5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/praxis/collection.rb', line 5
def self.of(type)
if defined?(type::Collection)
return type::Collection
end
klass = super
if type < Praxis::Types::MediaTypeCommon
unless type.identifier.nil?
klass.identifier(type.identifier + ';type=collection')
end
type.const_set :Collection, klass
else
warn "DEPRECATION: Praxis::Collection.of() for non-MediaTypes will be unsupported in 1.0. Use Attributor::Collection.of() instead."
Attributor::Collection.of(type)
end
end
|