Class: Protocol::HTTP::Header::TE::TransferCoding
- Inherits:
-
Struct
- Object
- Struct
- Protocol::HTTP::Header::TE::TransferCoding
- Defined in:
- lib/protocol/http/header/te.rb
Overview
A single transfer coding entry with optional quality factor
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
47 48 49 |
# File 'lib/protocol/http/header/te.rb', line 47 def name @name end |
#q ⇒ Object
Returns the value of attribute q
47 48 49 |
# File 'lib/protocol/http/header/te.rb', line 47 def q @q end |
Instance Method Details
#<=>(other) ⇒ Object
52 53 54 |
# File 'lib/protocol/http/header/te.rb', line 52 def <=> other other.quality_factor <=> self.quality_factor end |
#quality_factor ⇒ Object
48 49 50 |
# File 'lib/protocol/http/header/te.rb', line 48 def quality_factor (q || 1.0).to_f end |
#to_s ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/protocol/http/header/te.rb', line 56 def to_s if q && q != 1.0 "#{name};q=#{q}" else name.to_s end end |