Sha256: c2493ed8d611ada96d8c1229750b48837634ba9fabf0a41191528a4b35b16ba6

Contents?: true

Size: 875 Bytes

Versions: 41

Compression:

Stored size: 875 Bytes

Contents

# frozen_string_literal: true

module FinApps
  module REST
    class Portfolios < FinAppsCore::REST::Resources
      include FinApps::Utils::QueryBuilder

      def list(params = nil)
        return super if params.nil?
        raise FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash

        super build_query_path(end_point, params)
      end

      def show(id)
        not_blank(id, :id)
        super
      end

      def create(params)
        not_blank(params, :params)
        super params
      end

      def update(id, params)
        not_blank(id, :id)
        not_blank(params, :params)

        path = "#{end_point}/#{ERB::Util.url_encode(id)}"

        super params, path
      end

      def destroy(id)
        not_blank(id, :id)

        super
      end

      # need to populate build_filter method
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
finapps-5.0.32 lib/finapps/rest/portfolios.rb
finapps-5.0.31 lib/finapps/rest/portfolios.rb
finapps-5.0.30 lib/finapps/rest/portfolios.rb
finapps-5.0.29 lib/finapps/rest/portfolios.rb
finapps-5.0.28 lib/finapps/rest/portfolios.rb
finapps-5.0.27 lib/finapps/rest/portfolios.rb
finapps-5.0.26 lib/finapps/rest/portfolios.rb
finapps-5.0.25 lib/finapps/rest/portfolios.rb
finapps-5.0.24 lib/finapps/rest/portfolios.rb
finapps-5.0.23 lib/finapps/rest/portfolios.rb
finapps-5.0.22 lib/finapps/rest/portfolios.rb
finapps-5.0.21 lib/finapps/rest/portfolios.rb
finapps-5.0.20 lib/finapps/rest/portfolios.rb
finapps-5.0.19 lib/finapps/rest/portfolios.rb
finapps-5.0.17 lib/finapps/rest/portfolios.rb
finapps-5.0.16 lib/finapps/rest/portfolios.rb
finapps-5.0.15 lib/finapps/rest/portfolios.rb
finapps-5.0.14 lib/finapps/rest/portfolios.rb
finapps-5.0.13 lib/finapps/rest/portfolios.rb
finapps-5.0.12 lib/finapps/rest/portfolios.rb