class Desk::Collection
Public Class Methods
new(response, klass)
click to toggle source
Calls superclass method
# File lib/desk/collection.rb, line 4 def initialize(response, klass) @response = response super response["_embedded"]["entries"] coerce_into klass end
Private Instance Methods
coerce_into(klass)
click to toggle source
# File lib/desk/collection.rb, line 12 def coerce_into(klass) self.map! { |obj| klass.new(obj) } end