Sha256: 49138efc232cd1b7b0bdd8a5b8821ba5cc8fbbf2fb2c19ba583c419a225ebb44

Contents?: true

Size: 527 Bytes

Versions: 3

Compression:

Stored size: 527 Bytes

Contents

module Praxis

  # Stripped-down representation of an Internet Media Type where the structure and content of the
  # type are unknown, or are defined externally to the Praxis application.
  #
  # @see Praxis::MediaType
  # @see Praxis::Types::MediaTypeCommon
  SimpleMediaType = Struct.new(:identifier) do
    def name
      self.class.name
    end

    def id
      self.class.name.gsub("::",'-')
    end

    def describe(shallow=true)
      {name: name, family: "string", id: id, identifier: identifier}
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
praxis-0.20.0 lib/praxis/simple_media_type.rb
praxis-0.19.0 lib/praxis/simple_media_type.rb
praxis-0.18.1 lib/praxis/simple_media_type.rb