Class: Protocol::HTTP::Header::AcceptCharset::Charset

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



20
21
22
# File 'lib/protocol/http/header/accept_charset.rb', line 20

def name
  @name
end

#qObject

Returns the value of attribute q

Returns:

  • (Object)

    the current value of q



20
21
22
# File 'lib/protocol/http/header/accept_charset.rb', line 20

def q
  @q
end

Instance Method Details

#<=>(other) ⇒ Object



25
26
27
# File 'lib/protocol/http/header/accept_charset.rb', line 25

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

#quality_factorObject



21
22
23
# File 'lib/protocol/http/header/accept_charset.rb', line 21

def quality_factor
	(q || 1.0).to_f
end