Class: Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/feed_ninja/atomish.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id.



32
33
34
# File 'lib/feed_ninja/atomish.rb', line 32

def id
  @id
end

#imagesObject

Returns the value of attribute images.



32
33
34
# File 'lib/feed_ninja/atomish.rb', line 32

def images
  @images
end

Returns the value of attribute link.



32
33
34
# File 'lib/feed_ninja/atomish.rb', line 32

def link
  @link
end

#summaryObject

Returns the value of attribute summary.



32
33
34
# File 'lib/feed_ninja/atomish.rb', line 32

def summary
  @summary
end

#titleObject

Returns the value of attribute title.



32
33
34
# File 'lib/feed_ninja/atomish.rb', line 32

def title
  @title
end

#updatedObject

Returns the value of attribute updated.



32
33
34
# File 'lib/feed_ninja/atomish.rb', line 32

def updated
  @updated
end

Instance Method Details

#contentObject



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_sObject



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