I have written a quick n dirty code to display the first 4 RSS entries
from a feed using “feedzirra” gem. The code is pretty straight forward: https://gist.github.com/4578863
I have two questions, related to this code:
Is there any more elegant[1] way to get the first for elements of
‘@entries’ object array?
How should be defined the “feed_list” method in order to be called
like: feed = NewsDisplay::feed_list
I know I should put a ‘self’ reference somewhere. A little explanation
of who this technique works would be nice. I know that Class::method
calls might be
deprecated in the future. However even “Class.method” looks much more
elegant and I’d like to know how to implement it.
Best Regards,
[1] Elegant = Easy to read, concise code snippet. Cryptic snippets are
not elegant imho.
On Sun, Jan 20, 2013 at 8:08 AM, Panagiotis A. [email protected]wrote:
How should be defined the “feed_list” method in order to be called
[1] Elegant = Easy to read, concise code snippet. Cryptic snippets are not
their level and beat you with experience."
I prefer bracket notation because it works anywhere in an array