Class: Feedlr::Collection
- Inherits:
-
Array
- Object
- Array
- Feedlr::Collection
- 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
-
#initialize(data) ⇒ Feedlr::Collection
constructor
Initializer.
Constructor Details
#initialize(data) ⇒ Feedlr::Collection
Initializer
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 |