From: "Sandor Szücs" Date: 2013-01-20T23:26:56+09:00 Subject: Re: 2Q: Getting first 4 elements from array and calling class methods directly On 1/20/13 3:08 PM, Panagiotis Atmatzidis wrote: > 1) Is there any more elegant[1] way to get the first for elements of '@entries' object array? irb:0> a = (1..10).to_a => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] irb:0> a.take(3) => [1, 2, 3] irb:0> a => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] irb:0> a.pop(3) => [8, 9, 10] irb:0> a => [1, 2, 3, 4, 5, 6, 7] irb:0> a.shift(3) => [1, 2, 3] irb:0> a => [4, 5, 6, 7] > 2) How should be defined the "feed_list" method in order to be called like: feed = NewsDisplay::feed_list 1 class NewsDisplay� 2 def self.feed_list(*args)� 3 new(*args).feed_list� 4 end� 5 def initialize(*args)� 6 end� 7 def feed_list� 8 ['f','e','e','d']� 9 end� 10 end� 11 def test� 12 feed = NewsDisplay::feed_list� 13 end� irb:0> test => ["f", "e", "e", "d"] Hth. -- All the best, Sandor Sz�cs