Class: Mime::Mimes

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/action_dispatch/http/mime_type.rb

Instance Method Summary collapse

Constructor Details

#initializeMimes

Returns a new instance of Mimes.



12
13
14
15
# File 'lib/action_dispatch/http/mime_type.rb', line 12

def initialize
  @mimes = []
  @symbols = nil
end

Instance Method Details

#<<(type) ⇒ Object



21
22
23
24
# File 'lib/action_dispatch/http/mime_type.rb', line 21

def <<(type)
  @mimes << type
  @symbols = nil
end

#delete_ifObject



26
27
28
# File 'lib/action_dispatch/http/mime_type.rb', line 26

def delete_if
  @mimes.delete_if { |x| yield x }.tap { @symbols = nil }
end

#eachObject



17
18
19
# File 'lib/action_dispatch/http/mime_type.rb', line 17

def each
  @mimes.each { |x| yield x }
end

#symbolsObject



30
31
32
# File 'lib/action_dispatch/http/mime_type.rb', line 30

def symbols
  @symbols ||= map(&:to_sym)
end