travis-api/lib/travis/api/app/service/profile.rb
2012-07-18 14:56:41 +02:00

33 lines
612 B
Ruby

module Travis
module Api
class App
class Service
class Profile < Service
attr_reader :user
def initialize(user)
@user = user
end
def element
user
end
def sync
unless user.is_syncing?
publisher.publish({ user_id: user.id }, type: 'sync')
user.update_attribute(:is_syncing, true)
end
end
private
def publisher
Travis::Amqp::Publisher.new('sync.user')
end
end
end
end
end
end