Class: Feedlr::Collection

Inherits:
Array
  • Object
show all
Defined in:
lib/feedlr/collection.rb

Overview

When the response is of Array type, it creates an array of Feedlr::Base or plain types elements

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Feedlr::Collection

Initializer

Parameters:

  • data (Array)


8
9
10
11
12
13
# File 'lib/feedlr/collection.rb', line 8

def initialize(data)
  super([])
  data.each do |e|
    self.<<(e.is_a?(Hash) ? Feedlr::Base.new(e) : e)
  end
end