Class: Feed2Email::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/feed2email/entry.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, feed) ⇒ Entry

Returns a new instance of Entry.



9
10
11
12
# File 'lib/feed2email/entry.rb', line 9

def initialize(data, feed)
  @data = data
  @feed = feed
end

Instance Attribute Details

#feedObject (readonly)

Returns the value of attribute feed.



3
4
5
# File 'lib/feed2email/entry.rb', line 3

def feed
  @feed
end

Class Method Details

.process(data, feed) ⇒ Object



5
6
7
# File 'lib/feed2email/entry.rb', line 5

def self.process(data, feed)
  Entry.new(data, feed).process
end

Instance Method Details

#authorObject



14
15
16
# File 'lib/feed2email/entry.rb', line 14

def author
  @data.author
end

#contentObject



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

def content
  @data.content || @data.summary
end

#processObject



22
23
24
# File 'lib/feed2email/entry.rb', line 22

def process
  to_mail.send if to_be_sent?
end

#titleObject



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

def title
  @data.title
end

#uriObject



30
31
32
# File 'lib/feed2email/entry.rb', line 30

def uri
  @data.url
end