class Unsplash::SearchResult

Decorates Array of klass-type objects with total and total_pages attributes

Attributes

total[R]
total_pages[R]

Public Class Methods

new(decorated, klass) click to toggle source
Calls superclass method
# File lib/unsplash/search.rb, line 7
def initialize(decorated, klass)
  @total = decorated["total"]
  @total_pages = decorated["total_pages"]

  list = decorated["results"].map do |content|
    klass.new content.to_hash
  end

  super(list)
end