Module: ROM::Files::Plugins::Schema::Mime::DSL Private

Defined in:
lib/rom/files/plugins/schema/mime.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#mime(name = :mime_type, inline_type = TYPE, type: inline_type) ⇒ Object

Sets non-default contents attribute

Examples:

Set custom attribute name #type for MIME-type

schema do
  use :mime
  mime :type
end


47
48
49
50
51
52
53
# File 'lib/rom/files/plugins/schema/mime.rb', line 47

def mime(name = :mime_type, inline_type = TYPE, type: inline_type)
  options = plugin_options(:mime)
  options[:name] = name
  options[:type] = type

  self
end