Class: Protocol::HTTP::Header::AcceptLanguage::Language

Inherits:
Struct
  • Object
show all
Defined in:
lib/protocol/http/header/accept_language.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



26
27
28
# File 'lib/protocol/http/header/accept_language.rb', line 26

def name
  @name
end

#qObject

Returns the value of attribute q

Returns:

  • (Object)

    the current value of q



26
27
28
# File 'lib/protocol/http/header/accept_language.rb', line 26

def q
  @q
end

Instance Method Details

#<=>(other) ⇒ Object



31
32
33
# File 'lib/protocol/http/header/accept_language.rb', line 31

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

#quality_factorObject



27
28
29
# File 'lib/protocol/http/header/accept_language.rb', line 27

def quality_factor
	(q || 1.0).to_f
end