Class: Twog::Post
- Inherits:
-
Object
- Object
- Twog::Post
- Defined in:
- lib/twog/post.rb
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #date ⇒ Object
-
#initialize(post) ⇒ Post
constructor
A new instance of Post.
- #link ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(post) ⇒ Post
5 6 7 |
# File 'lib/twog/post.rb', line 5 def initialize(post) @post = post end |
Instance Method Details
#<=>(other) ⇒ Object
21 22 23 |
# File 'lib/twog/post.rb', line 21 def <=>(other) Time.parse(date.to_s) <=> Time.parse(other.date.to_s) end |
#date ⇒ Object
13 14 15 |
# File 'lib/twog/post.rb', line 13 def date @post.respond_to?('updated') ? @post.updated.content : @post.pubDate end |
#link ⇒ Object
9 10 11 |
# File 'lib/twog/post.rb', line 9 def link @post.link.respond_to?('href') ? @post.link.href : @post.link end |
#title ⇒ Object
17 18 19 |
# File 'lib/twog/post.rb', line 17 def title @post.title.respond_to?('content') ? @post.title.content : @post.title end |