class Newly::News

Attributes

feed_url[R]
image[R]
subtitle[R]
title[R]
url[R]

Public Class Methods

new(args) click to toggle source
# File lib/newly/news.rb, line 5
def initialize(args)
  page_crawler = args[:page_crawler]
  feed = args[:feed]

  @feed_url = args[:feed_url]
  @url = page_crawler.link feed.url_pattern
  @title = page_crawler.titleize feed.title
  @subtitle = page_crawler.titleize feed.subtitle
  @image = page_crawler.image feed.image_source
end

Public Instance Methods

to_hash() click to toggle source
# File lib/newly/news.rb, line 16
def to_hash
  {
    url: @url,
    title: @title,
    subtitle: @subtitle,
    image: @image,
    feed_url: @feed_url
  }
end