Permalink
Browse files

memoize attributes

  • Loading branch information...
1 parent 8f67c1c commit e0434253b31c48d7a38908757c7e002304fdcf9e @archiloque archiloque committed Jul 2, 2011
@@ -16,7 +16,7 @@ def parse_datetime(string)
##
# Returns the id of the entry or its url if not id is present, as some formats don't support it
def id
- @entry_id || @url
+ @entry_id ||= @url
end
##
@@ -28,7 +28,7 @@ def url
end
def feed_url
- @feed_url || links.first
+ @feed_url ||= links.first
end
end
end
@@ -30,7 +30,7 @@ class AtomEntry
elements :link, :as => :links, :value => :href
def url
- @url || links.first
+ @url ||= links.first
end
end
@@ -31,7 +31,7 @@ class AtomFeedBurnerEntry
elements :link, :as => :links, :value => :href
def url
- @url || links.first
+ @url ||= links.first
end
end

0 comments on commit e043425

Please sign in to comment.