travis-api/lib/travis/api/v2/http/broadcasts.rb

33 lines
647 B
Ruby

module Travis
module Api
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