travis-api/lib/travis/api/v3/services/env_var/find.rb
Joe Corcoran f5bc526f25 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-07-01 23:55:49 -04:00

12 lines
247 B
Ruby

module Travis::API::V3
class Services::EnvVar::Find < Service
params :id, prefix: :repository
params :id, prefix: :env_var
def run!
repository = check_login_and_find(:repository)
query.find(repository)
end
end
end