Class: Mime::Mimes
- Inherits:
-
Object
- Object
- Mime::Mimes
- Includes:
- Enumerable
- Defined in:
- 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.
Constructor Details
#initialize ⇒ Mimes
Returns a new instance of Mimes.
11 12 13 14 |
# File '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 'lib/action_dispatch/http/mime_type.rb', line 7 def symbols @symbols end |
Instance Method Details
#<<(type) ⇒ Object
20 21 22 23 |
# File '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 '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 'lib/action_dispatch/http/mime_type.rb', line 16 def each(&block) @mimes.each(&block) end |