Class: Feed2Email::Entry

Inherits:
Object
  • Object
show all
Includes:
Configurable, Loggable
Defined in:
lib/feed2email/entry.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Loggable

#logger

Methods included from Configurable

#config

Class Attribute Details

.last_email_sent_atObject

Returns the value of attribute last_email_sent_at.



19
20
21
# File 'lib/feed2email/entry.rb', line 19

def last_email_sent_at
  @last_email_sent_at
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



25
26
27
# File 'lib/feed2email/entry.rb', line 25

def data
  @data
end

#feed_dataObject

Returns the value of attribute feed_data.



26
27
28
# File 'lib/feed2email/entry.rb', line 26

def feed_data
  @feed_data
end

#feed_uriObject

Returns the value of attribute feed_uri.



27
28
29
# File 'lib/feed2email/entry.rb', line 27

def feed_uri
  @feed_uri
end

Instance Method Details

#processObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/feed2email/entry.rb', line 29

def process
  if missing_data?
    logger.warn 'Skipping entry with missing data...'
    return false
  end

  unless feed.old?
    logger.debug 'Skipping new feed entry...'
    save # record as seen
    return true
  end

  if old?
    logger.debug 'Skipping old entry...'
    return true
  end

  return send_mail
end