HabitatMap/AirCasting

View on GitHub
app/controllers/api/mobile/streams_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Api
  class Mobile::StreamsController < BaseController
    respond_to :json

    def show
      GoogleAnalyticsWorker::RegisterEvent.async_call('Mobile streams#show')
      hash = Api::ToMobileSessionHash.new(stream: stream).call
      render json: hash, status: :ok
    end

    private

    def stream
      @stream ||= Stream.mobile.find(id)
    end

    def id
      @id ||= params.fetch(:id)
    end
  end
end