Module: ROM::Files::Plugins::Schema::Mime
- Defined in:
- lib/rom/files/plugins/schema/mime.rb
Overview
A plugin for obtaining MIME-type of file using its name
Defined Under Namespace
Modules: DSL
Constant Summary collapse
Class Method Summary collapse
Class Method Details
.apply(schema, name: :mime_type, type: TYPE) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rom/files/plugins/schema/mime.rb', line 24 def self.apply(schema, name: :mime_type, type: TYPE) mime_type = type.( name: name, __proc__: PROC, source: schema.name ) schema.attributes.concat( schema.class.attributes([mime_type], schema.attr_class) ) end |