class Praxis::Collection
Public Class Methods
Source
# File lib/praxis/collection.rb, line 36 def self.as_json_schema(**_args) the_type = @attribute&.type || member_type { type: json_schema_type, items: the_type.as_json_schema } end
Source
# File lib/praxis/collection.rb, line 28 def self.domain_model @member_type.domain_model end
Source
# File lib/praxis/collection.rb, line 32 def self.json_schema_type :array end
Source
# File lib/praxis/collection.rb, line 19 def self.member_type(type = nil) unless type.nil? @member_type = type identifier("#{type.identifier};type=collection") unless type.identifier.nil? end @member_type end
Source
# File lib/praxis/collection.rb, line 7 def self.of(type) return type::Collection if defined?(type::Collection) klass = super klass.anonymous_type raise 'Praxis::Collection.of() for non-MediaTypes is unsupported. Use Attributor::Collection.of() instead.' unless type < Praxis::Types::MediaTypeCommon klass.member_type type type.const_set :Collection, klass end
Calls superclass method