travis-api/lib/travis/api/v3/renderer/collection.rb
2015-01-23 19:27:01 +01:00

12 lines
311 B
Ruby

module Travis::API::V3
module Renderer::Collection
extend self
def render(collection_type, entry_type, entries, **additional)
entries &&= entries.map { |entry| Renderer[entry_type].render(entry) }
{ :@type => collection_type, collection_type => entries, **additional }
end
end
end