Class: GozapRss::ChoutiRssBase

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

Direct Known Subclasses

ChoutiRss, ChoutiRssItem

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



55
56
57
# File 'lib/gozap_rss/chouti_rss.rb', line 55

def content
  @content
end

#descriptionObject (readonly)

Returns the value of attribute description.



55
56
57
# File 'lib/gozap_rss/chouti_rss.rb', line 55

def description
  @description
end

#http_headers_optionObject

Returns the value of attribute http_headers_option.



56
57
58
# File 'lib/gozap_rss/chouti_rss.rb', line 56

def http_headers_option
  @http_headers_option
end

#pub_dateObject (readonly)

Returns the value of attribute pub_date.



55
56
57
# File 'lib/gozap_rss/chouti_rss.rb', line 55

def pub_date
  @pub_date
end

#titleObject (readonly)

Returns the value of attribute title.



55
56
57
# File 'lib/gozap_rss/chouti_rss.rb', line 55

def title
  @title
end

#ttlObject (readonly)

Returns the value of attribute ttl.



55
56
57
# File 'lib/gozap_rss/chouti_rss.rb', line 55

def ttl
  @ttl
end

#urlObject (readonly)

Returns the value of attribute url.



55
56
57
# File 'lib/gozap_rss/chouti_rss.rb', line 55

def url
  @url
end

Class Method Details

.loggerObject



27
28
29
# File 'lib/gozap_rss/chouti_rss.rb', line 27

def self.logger
  @logger || GozapRss.logger || Logger.new(STDOUT)
end

.logger=(logger) ⇒ Object



31
32
33
# File 'lib/gozap_rss/chouti_rss.rb', line 31

def self.logger= logger
  @logger = logger if logger
end

.logger_exception(e) ⇒ Object



35
36
37
38
# File 'lib/gozap_rss/chouti_rss.rb', line 35

def self.logger_exception e
  logger.error e
  logger.error e.backtrace
end

Instance Method Details

#log_failed(response) ⇒ Object



44
45
46
47
48
# File 'lib/gozap_rss/chouti_rss.rb', line 44

def log_failed(response)
  msg = "#{response.code} URL: #{response.request.url}  PARAMS: #{response.request.params.to_s} in #{response.time}s FAILED :  #{response.curl_error_message}
  BODY: #{response.body}"
  logger.error(msg)
end

#loggerObject



40
41
42
# File 'lib/gozap_rss/chouti_rss.rb', line 40

def logger
  self.class.logger
end

#logger_exception(e) ⇒ Object



50
51
52
# File 'lib/gozap_rss/chouti_rss.rb', line 50

def logger_exception e
  self.class.logger_exception e
end