module ROM::Files::Dataset::MimeType

Public Class Methods

included(other) click to toggle source
Calls superclass method
# File lib/rom/files/dataset/mime_type.rb, line 10
def self.included(other)
  super(other)
  other.module_eval do
    option :mime_type, Types::MimeType.optional,
           default: -> { nil }

    prepend Initializer
  end
end

Public Instance Methods

mime(type = nil) click to toggle source

@param type [String, nil] @return [Dataset]

# File lib/rom/files/dataset/mime_type.rb, line 37
def mime(type = nil)
  type = Types::MimeType[type] if type
  with(mime_type: type)
end