Module: Coyote::Representation

Defined in:
lib/coyote/representation.rb

Overview

Utility functions for managing Representations

Constant Summary collapse

STATUSES =

Enumerates all states that a Representation can be in, corresponding to the database's resource_status enum

{
  ready_to_review: 'ready_to_review',
  approved:        'approved',
  not_approved:    'not_approved'
}.freeze
CONTENT_TYPES =

A list of MIME types for which Coyote accepts representations

%w[
  text/plain
  text/html
  audio/mp3
  audio/ogg
  audio/midi
  audio/webm
  audio/3gpp
  audio/3gpp2
  image/gif
  image/png
  image/jpeg
  image/tiff
  image/svg+xml
  video/mpeg
  video/ogg
  video/webm
  video/3gpp
  video/3gpp2
].freeze

Class Method Summary collapse

Class Method Details

.status_collectionArray<Symbol>

Returns list of all available statuses for use in forms

Returns:

  • (Array<Symbol>)

    list of all available statuses for use in forms



38
39
40
41
42
# File 'lib/coyote/representation.rb', line 38

def self.status_collection
  STATUSES.each_key.map do |status|
    [status.to_s.titleize, status]
  end
end