Class: Mime::Mimes
- Includes:
- Enumerable
- Defined in:
- actionpack/lib/action_dispatch/http/mime_type.rb
Instance Attribute Summary collapse
-
#symbols ⇒ Object
readonly
Returns the value of attribute symbols.
Instance Method Summary collapse
- #<<(type) ⇒ Object
- #delete_if ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ Mimes
constructor
A new instance of Mimes.
Methods included from Enumerable
Constructor Details
#initialize ⇒ Mimes
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
#symbols ⇒ Object (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_if ⇒ Object
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 |