Class: Entry
- Inherits:
-
Object
- Object
- Entry
- Defined in:
- lib/feed_ninja/atomish.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#images ⇒ Object
Returns the value of attribute images.
-
#link ⇒ Object
Returns the value of attribute link.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated ⇒ Object
Returns the value of attribute updated.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
32 33 34 |
# File 'lib/feed_ninja/atomish.rb', line 32 def id @id end |
#images ⇒ Object
Returns the value of attribute images.
32 33 34 |
# File 'lib/feed_ninja/atomish.rb', line 32 def images @images end |
#link ⇒ Object
Returns the value of attribute link.
32 33 34 |
# File 'lib/feed_ninja/atomish.rb', line 32 def link @link end |
#summary ⇒ Object
Returns the value of attribute summary.
32 33 34 |
# File 'lib/feed_ninja/atomish.rb', line 32 def summary @summary end |
#title ⇒ Object
Returns the value of attribute title.
32 33 34 |
# File 'lib/feed_ninja/atomish.rb', line 32 def title @title end |
#updated ⇒ Object
Returns the value of attribute updated.
32 33 34 |
# File 'lib/feed_ninja/atomish.rb', line 32 def updated @updated end |
Instance Method Details
#content ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/feed_ninja/atomish.rb', line 45 def content Array(@images).inject("") do |memo, src| memo += %{ <a href="#{src}"> <img src="#{src}"/> </a> } #end + summary || "" end end |
#to_s ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/feed_ninja/atomish.rb', line 34 def to_s %{ <entry> <title>#{@title}</title> <link rel="alternate" type="text/html" href="#{@link}" /> <id>#{@id}</id> <updated>#{@updated}</updated> <content type="html">#{self.content.encode(:xml => :text)}</content> </entry> } end |