Sha256: 0f39ee1a975e067cb990498dfbd14657aa9732bb720aff85fa3ac0b8a519a808

Contents?: true

Size: 1.12 KB

Versions: 17

Compression:

Stored size: 1.12 KB

Contents

module FinApps
  module REST

    require 'erb'

    class Cashflow < FinApps::REST::Resources
      include FinApps::REST::Defaults

      # @param [Date] start_date
      # @param [Date] end_date
      # @return [Hash, Array<String>]
      def show(start_date, end_date)
        logger.debug "##{__method__.to_s} => Started"

        raise MissingArgumentsError.new 'Missing argument: start_date.' if start_date.blank?
        logger.debug "##{__method__.to_s} => start_date: #{start_date}"
        raise MissingArgumentsError.new 'Missing argument: end_date.' if end_date.blank?
        logger.debug "##{__method__.to_s} => end_date: #{end_date}"

        end_point = Defaults::END_POINTS[:cashflow_show]
        logger.debug "##{__method__.to_s} => end_point: #{end_point}"

        path = end_point.sub(':start_date', ERB::Util.url_encode(start_date)).sub(':end_date', ERB::Util.url_encode(end_date))
        logger.debug "##{__method__.to_s} => path: #{path}"

        budget, error_messages = @client.send(path, :get)

        logger.debug "##{__method__.to_s} => Completed"
        return budget, error_messages
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
finapps-0.15.2.pre lib/finapps/rest/cashflow.rb
finapps-0.15.1.pre lib/finapps/rest/cashflow.rb
finapps-0.15.0.pre lib/finapps/rest/cashflow.rb
finapps-0.14.5.pre lib/finapps/rest/cashflow.rb
finapps-0.14.3.pre lib/finapps/rest/cashflow.rb
finapps-0.14.2.pre lib/finapps/rest/cashflow.rb
finapps-0.14.1.pre lib/finapps/rest/cashflow.rb
finapps-0.14.0.pre lib/finapps/rest/cashflow.rb
finapps-0.13.1.pre lib/finapps/rest/cashflow.rb
finapps-0.13.0.pre lib/finapps/rest/cashflow.rb
finapps-0.12.5.pre lib/finapps/rest/cashflow.rb
finapps-0.12.4.pre lib/finapps/rest/cashflow.rb
finapps-0.12.3.pre lib/finapps/rest/cashflow.rb
finapps-0.12.2.pre lib/finapps/rest/cashflow.rb
finapps-0.12.1.pre lib/finapps/rest/cashflow.rb
finapps-0.12.0.pre lib/finapps/rest/cashflow.rb
finapps-0.11.0.pre lib/finapps/rest/cashflow.rb