struct

Fetcher::Result

Inherits Struct < Value < Object

Constructors

error(kind : ErrorKind, message : String, status_code : Int32 | Nil = nil) : Result
Source
error(err : Error) : Result
Source
new(entries : Array(Entry), etag : String | Nil, last_modified : String | Nil, site_link : String | Nil, favicon : String | Nil, error : Error | Nil = nil, feed_title : String | Nil = nil, feed_description : String | Nil = nil, feed_language : String | Nil = nil, feed_authors : Array(Author) = [] of Author)
Source
success(entries : Array(Entry), etag : String | Nil = nil, last_modified : String | Nil = nil) : Result

Creates a success result with essential fields only. For optional metadata (site_link, favicon, feed_title, etc.), use Builder instead:

Result.builder .entries(entries) .etag(etag) .site_link("https://example.com") .favicon("https://example.com/favicon.ico") .build

Source
with_site_link(entries : Array(Entry), site_link : String | Nil) : Result

Test helper for creating results with site_link (used by specs)

Source

Class methods

builder
Source

Instance methods

clone
Source
entries
error
error_message
Source
etag
favicon
feed_authors
feed_description
feed_language
feed_title
last_modified
success?
Source

Nested types