class TvMaze::ApiResource
Private Class Methods
build_collection(response, representer)
click to toggle source
# File lib/tv_maze/models/api_resource.rb, line 10 def self.build_collection(response, representer) response.reduce([]) do |resources, response| resources << self.new.extend(representer).from_hash(response) end end
build_single_resource(response, representer)
click to toggle source
# File lib/tv_maze/models/api_resource.rb, line 6 def self.build_single_resource(response, representer) self.new.extend(representer).from_hash(response) end
Private Instance Methods
build_for_collection(response, representer)
click to toggle source
# File lib/tv_maze/models/api_resource.rb, line 16 def build_for_collection(response, representer) [].extend(representer.for_collection).from_hash(response) end