Module: Tilia::Http::Util Deprecated

Defined in:
lib/tilia/http/util.rb

Overview

Deprecated.

All these functions moved to the Tilia::Http namespace

HTTP utility methods

Class Method Summary collapse

Class Method Details

.negotiate(accept_header_value, available_options) ⇒ String?

Deprecated.

Use Tilia::Http::negotiate_content_type

Deprecated! Use negotiateContentType.

Parameters:

  • accept_header (String, nil)
  • array

    available_options

Returns:

  • (String, nil)


23
24
25
# File 'lib/tilia/http/util.rb', line 23

def self.negotiate(accept_header_value, available_options)
  Http.negotiate_content_type(accept_header_value, available_options)
end

.negotiate_content_type(accept_header_value, available_options) ⇒ String?

Deprecated.

Use Tilia::Http::negotiate_content_type

Content negotiation

Parameters:

  • accept_header_value (String, nil)
  • array

    available_options

Returns:

  • (String, nil)


13
14
15
# File 'lib/tilia/http/util.rb', line 13

def self.negotiate_content_type(accept_header_value, available_options)
  Http.negotiate_content_type(accept_header_value, available_options)
end

.parse_http_date(date_header) ⇒ Object

Deprecated.

Use Tilia::Http::parse_date

Parses a RFC2616-compatible date string

This method returns false if the date is invalid

Parameters:

  • date_header (String)

Returns:

  • bool|DateTime



34
35
36
# File 'lib/tilia/http/util.rb', line 34

def self.parse_http_date(date_header)
  Http.parse_date(date_header)
end

.to_http_date(date_time) ⇒ String

Deprecated.

Use Tilia::Http::to_date

Transforms a DateTime object to HTTP’s most common date format.

We’re serializing it as the RFC 1123 date, which, for HTTP must be specified as GMT.

Parameters:

  • \DateTime

    date_time

Returns:

  • (String)


46
47
48
# File 'lib/tilia/http/util.rb', line 46

def self.to_http_date(date_time)
  Http.to_date(date_time)
end