travis-api/lib/travis/api/v3/services/account/find.rb
2015-04-13 13:12:18 +02:00

21 lines
391 B
Ruby

module Travis::API::V3
class Services::Account::Find < Service
def result_type
@result_type ||= super
end
def run!
account = find
@result_type = type_for(account)
account
end
def type_for(account)
case account
when Models::User then :user
when Models::Organization then :organization
end
end
end
end