travis-api/lib/travis/api/v3/services/env_var/update.rb
Joe Corcoran 88d9000042 Refactor repeated pattern into extracted method
Seems like we'll be checking login status before finding a resource
a lot, so here's a standard way to do it.
2016-06-21 15:34:11 +02:00

12 lines
275 B
Ruby

module Travis::API::V3
class Services::EnvVar::Update < Service
params :id, prefix: :repository
params :id, :name, :value, :public, prefix: :env_var
def run!
repository = check_login_and_find(:repository)
query.update(repository)
end
end
end