Class: Protocol::HTTP::Header::AcceptLanguage::Language
- Inherits:
-
Struct
- Object
- Struct
- Protocol::HTTP::Header::AcceptLanguage::Language
- Defined in:
- lib/protocol/http/header/accept_language.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#q ⇒ Object
Returns the value of attribute q.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
26 27 28 |
# File 'lib/protocol/http/header/accept_language.rb', line 26 def name @name end |
#q ⇒ Object
Returns the value of attribute 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_factor ⇒ Object
27 28 29 |
# File 'lib/protocol/http/header/accept_language.rb', line 27 def quality_factor (q || 1.0).to_f end |