Class: Mime::Mimes

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Enumerable

#as_json

Constructor Details

#initializeMimes

Returns a new instance of Mimes.



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

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

Instance Attribute Details

#symbolsObject (readonly)

Returns the value of attribute symbols



7
8
9
# File 'actionpack/lib/action_dispatch/http/mime_type.rb', line 7

def symbols
  @symbols
end

Instance Method Details

#<<(type) ⇒ Object



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

def <<(type)
  @mimes << type
  @symbols << type.to_sym
end

#delete_ifObject



25
26
27
28
29
30
31
32
# File 'actionpack/lib/action_dispatch/http/mime_type.rb', line 25

def delete_if
  @mimes.delete_if do |x|
    if yield x
      @symbols.delete(x.to_sym)
      true
    end
  end
end

#each(&block) ⇒ Object



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

def each(&block)
  @mimes.each(&block)
end