Class: Flattr::Search

Inherits:
Base
  • Object
show all
Defined in:
lib/flattr/search.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], lazy_attr_reader, lazy_attr_writer

Constructor Details

#initialize(attrs = {}) ⇒ Search

Returns a new instance of Search.



8
9
10
11
12
13
14
15
16
17
# File 'lib/flattr/search.rb', line 8

def initialize(attrs={})
  if attrs["items"] > 0
    items = []
    attrs["things"].each do |item|
      items << Flattr::Thing.new(item)
    end
    attrs["things"] = items
  end
  super attrs
end