Module: Coyote::Resource
- Defined in:
- lib/coyote/resource.rb
Overview
Utility functions for managing Resources
Constant Summary collapse
- TYPES =
Categories to which a resource can belong, corresponding to the resource_type database enum
{ collection: 'collection', dataset: 'dataset', event: 'event', image: 'image', interactive_resource: 'interactive_resource', moving_image: 'moving_image', physical_object: 'physical_object', service: 'service', software: 'software', sound: 'sound', still_image: 'still_image', text: 'text' }.freeze
- IMAGE_LIKE_TYPES =
%i[image moving_image still_image].freeze
Class Method Summary collapse
-
.each_type {|human_friendly_type, type| ... } ⇒ Object
Iterates through all possible Resource types.
-
.type_names ⇒ Array<Symbol>
List of all available types.
Class Method Details
.each_type {|human_friendly_type, type| ... } ⇒ Object
Iterates through all possible Resource types
28 29 30 31 32 |
# File 'lib/coyote/resource.rb', line 28 def self.each_type TYPES.each_key do |type| yield type.to_s.titleize, type end end |
.type_names ⇒ Array<Symbol>
Returns list of all available types
35 36 37 |
# File 'lib/coyote/resource.rb', line 35 def self.type_names TYPES.keys end |