Class: Hanami::Action::Mime::RequestMimeWeight Private
- Inherits:
-
Object
- Object
- Hanami::Action::Mime::RequestMimeWeight
- Includes:
- Comparable
- Defined in:
- lib/hanami/action/mime.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #format ⇒ Object readonly private
- #index ⇒ Object readonly private
- #mime ⇒ Object readonly private
- #priority ⇒ Object readonly private
- #quality ⇒ Object readonly private
Instance Method Summary collapse
- #<=>(other) ⇒ Object private
-
#initialize(mime, quality, index, format = mime) ⇒ RequestMimeWeight
constructor
private
A new instance of RequestMimeWeight.
Constructor Details
#initialize(mime, quality, index, format = mime) ⇒ RequestMimeWeight
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RequestMimeWeight.
637 638 639 640 |
# File 'lib/hanami/action/mime.rb', line 637 def initialize(mime, quality, index, format = mime) @quality, @index, @format = quality, index, format calculate_priority(mime) end |
Instance Attribute Details
#format ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
629 630 631 |
# File 'lib/hanami/action/mime.rb', line 629 def format @format end |
#index ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
621 622 623 |
# File 'lib/hanami/action/mime.rb', line 621 def index @index end |
#mime ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
625 626 627 |
# File 'lib/hanami/action/mime.rb', line 625 def mime @mime end |
#priority ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
633 634 635 |
# File 'lib/hanami/action/mime.rb', line 633 def priority @priority end |
#quality ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
617 618 619 |
# File 'lib/hanami/action/mime.rb', line 617 def quality @quality end |
Instance Method Details
#<=>(other) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
644 645 646 647 |
# File 'lib/hanami/action/mime.rb', line 644 def <=>(other) return priority <=> other.priority unless priority == other.priority other.index <=> index end |