travis-api/lib/travis/api/v3/renderer/collection.rb
2015-02-11 10:05:08 +01:00

11 lines
310 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