Class: Protocol::HTTP::Header::AcceptEncoding::Encoding

Inherits:
Struct
  • Object
show all
Defined in:
lib/protocol/http/header/accept_encoding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



23
24
25
# File 'lib/protocol/http/header/accept_encoding.rb', line 23

def name
  @name
end

#qObject

Returns the value of attribute q

Returns:

  • (Object)

    the current value of q



23
24
25
# File 'lib/protocol/http/header/accept_encoding.rb', line 23

def q
  @q
end

Instance Method Details

#<=>(other) ⇒ Object



28
29
30
# File 'lib/protocol/http/header/accept_encoding.rb', line 28

def <=> other
	other.quality_factor <=> self.quality_factor
end

#quality_factorObject



24
25
26
# File 'lib/protocol/http/header/accept_encoding.rb', line 24

def quality_factor
	(q || 1.0).to_f
end