Sha256: 507271b15c40bafcc66e7b7a6ab5345d7e4ca1d636843fc526a2d88a732ac742

Contents?: true

Size: 610 Bytes

Versions: 5

Compression:

Stored size: 610 Bytes

Contents

module T2Airtime
  # Proxy products information
  class ProductsController < ApplicationController
    def index
      @products = T2Airtime::Product.all(permitted_params[:operator_id])
      if @products.success?
        render_data T2Airtime::Product.serialize @products.data,
                                                 @products.headers[:date]
      else
        render_error T2Airtime::Error.new @products.error_code,
                                          @products.error_message
      end
    end

    private

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
t2_airtime-0.5.1 app/controllers/t2_airtime/products_controller.rb
t2_airtime-0.5.0 app/controllers/t2_airtime/products_controller.rb
t2_airtime-0.4.1 app/controllers/t2_airtime/products_controller.rb
t2_airtime-0.4.0 app/controllers/t2_airtime/products_controller.rb
t2_airtime-0.3.1 app/controllers/t2_airtime/products_controller.rb