module Praxis::Types::MediaTypeCommon::ClassMethods
Public Instance Methods
Source
# File lib/praxis/types/media_type_common.rb, line 10 def as_json_schema(**args) the_type = @attribute&.type || member_type the_type.as_json_schema(**args) end
Source
# File lib/praxis/types/media_type_common.rb, line 20 def description(text = nil) @description = text if text @description end
Source
# File lib/praxis/types/media_type_common.rb, line 25 def display_name(string = nil) unless string return @display_name ||= name.split('::').last # Best guess at a display name? end @display_name = string end
Source
# File lib/praxis/types/media_type_common.rb, line 36 def identifier(identifier = nil) return @identifier unless identifier @identifier = MediaTypeIdentifier.load(identifier) end
Get or set the identifier of this media type.
@return [MediaTypeIdentifier] the string-representation of this type’s identifier
Source
# File lib/praxis/types/media_type_common.rb, line 15 def json_schema_type the_type = @attribute&.type || member_type the_type.json_schema_type end