Sha256: 1bb8da801792d088be0bd03bb84e479d06bd44ecd978cc6bbec4c8a191d86c85

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 Bytes

Contents

module Praxis
  module Types

    module MediaTypeCommon
      extend ::ActiveSupport::Concern

      module ClassMethods
        def describe(shallow = false)
          hash = super
          unless shallow
            hash.merge!(identifier: @identifier, description: @description)
          end
          hash
        end

        def description(text=nil)
          @description = text if text
          @description
        end

        def identifier(identifier=nil)
          return @identifier unless identifier
          # TODO: parse the string and extract things like collection , and format type?...
          @identifier = identifier
        end
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
praxis-0.14.0 lib/praxis/types/media_type_common.rb