23 lines
432 B
Ruby
23 lines
432 B
Ruby
module Travis::API::V3
|
|
class Services::Owner::Find < Service
|
|
params :active, :private, prefix: :repository
|
|
|
|
def result_type
|
|
@result_type ||= super
|
|
end
|
|
|
|
def run!
|
|
owner = find
|
|
@result_type = type_for(owner)
|
|
owner
|
|
end
|
|
|
|
def type_for(owner)
|
|
case owner
|
|
when Models::User then :user
|
|
when Models::Organization then :organization
|
|
end
|
|
end
|
|
end
|
|
end
|