Class: Praxis::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/praxis/types/collection.rb

Class Method Summary collapse

Class Method Details

.of(type) ⇒ Object

checks if type is a MediaType, and if so, if it has an inner Collection class defined



7
8
9
10
11
12
13
# File 'lib/praxis/types/collection.rb', line 7

def self.of(type)
  if type < Attributor::Type && defined?(type::Collection)
    return type::Collection
  end

  Attributor::Collection.of(type)
end