travis-api/lib/travis/api/serialize/v2/http/broadcasts.rb
2016-06-18 17:52:48 +02:00

34 lines
721 B
Ruby

module Travis
module Api
module Serialize
module V2
module Http
class Broadcasts
attr_reader :broadcasts, :options
def initialize(broadcasts, options = {})
@broadcasts = broadcasts
@options = options
end
def data
{
'broadcasts' => broadcasts.map { |broadcast| broadcast_data(broadcast) }
}
end
private
def broadcast_data(broadcast)
{
'id' => broadcast.id,
'message' => broadcast.message
}
end
end
end
end
end
end
end