Class: Hanami::Action::Mime::RequestMimeWeight Private

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/hanami/action/mime/request_mime_weight.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.

Since:

  • 1.0.1

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Since:

  • 1.0.1



43
44
45
46
# File 'lib/hanami/action/mime/request_mime_weight.rb', line 43

def initialize(mime, quality, index, format = mime)
  @quality, @index, @format = quality, index, format
  calculate_priority(mime)
end

Instance Attribute Details

#formatObject (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.

Since:

  • 1.0.1



35
36
37
# File 'lib/hanami/action/mime/request_mime_weight.rb', line 35

def format
  @format
end

#indexObject (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.

Since:

  • 1.0.1



27
28
29
# File 'lib/hanami/action/mime/request_mime_weight.rb', line 27

def index
  @index
end

#mimeObject (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.

Since:

  • 1.0.1



31
32
33
# File 'lib/hanami/action/mime/request_mime_weight.rb', line 31

def mime
  @mime
end

#priorityObject (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.

Since:

  • 1.0.1



39
40
41
# File 'lib/hanami/action/mime/request_mime_weight.rb', line 39

def priority
  @priority
end

#qualityObject (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.

Since:

  • 1.0.1



23
24
25
# File 'lib/hanami/action/mime/request_mime_weight.rb', line 23

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.

Since:

  • 1.0.1



50
51
52
53
54
# File 'lib/hanami/action/mime/request_mime_weight.rb', line 50

def <=>(other)
  return priority <=> other.priority unless priority == other.priority

  other.index <=> index
end