Sha256: 2dc0655c250429b2a876ccd3d8f60742137ed986ddf1223534ee79a6ef9fc77f

Contents?: true

Size: 581 Bytes

Versions: 2

Compression:

Stored size: 581 Bytes

Contents

module T2Airtime
  # Proxy operators information
  class OperatorsController < ApplicationController
    def index
      @operators = T2Airtime::Operator.all(permitted_params[:country_id])
      if @operators.success?
        render_data T2Airtime::Operator.serialize @operators.data,
                                                  @operators.headers[:date]
      else
        render_error @operators
      end
    end

    # noop
    def show
      render_one 'operators'
    end

    private

    def permitted_params
      filter_params.permit(:country_id)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
t2_airtime-0.6.0 app/controllers/t2_airtime/operators_controller.rb
t2_airtime-0.5.2 app/controllers/t2_airtime/operators_controller.rb