Class: GozapRss::ChoutiRssItem

Inherits:
ChoutiRssBase show all
Defined in:
lib/gozap_rss/chouti_rss.rb

Instance Attribute Summary collapse

Attributes inherited from ChoutiRssBase

#description, #http_headers_option, #pub_date, #title, #ttl, #url

Instance Method Summary collapse

Methods inherited from ChoutiRssBase

#log_failed, logger, #logger, logger=, logger_exception, #logger_exception

Constructor Details

#initialize(item) ⇒ ChoutiRssItem

Returns a new instance of ChoutiRssItem.



114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/gozap_rss/chouti_rss.rb', line 114

def initialize item
  @title = item.title.to_s.html_format
  @pub_date = item.pubDate || item.lastBuildDate
  @description = item.description.to_s.html_format
  @url = item.link.to_s.strip
  @url_md5 = Digest::MD5.hexdigest(@url)
  unless validate
    logger.error "parser item error -- title=>#{@title}, pub_date=>#{@pub_date} description=>#{@description}, url=>#{@url}"
    return nil
  end
  self
end

Instance Attribute Details

#url_md5Object (readonly)

Returns the value of attribute url_md5.



112
113
114
# File 'lib/gozap_rss/chouti_rss.rb', line 112

def url_md5
  @url_md5
end