Class: PapierkramApi::V1::BusinessIntelligence::SmartQueries::ExpenseVouchersForMonthInYear

Inherits:
Object
  • Object
show all
Includes:
Helper::DateHelper
Defined in:
lib/papierkram_api/v1/business_intelligence/smart_queries/expense_vouchers_for_month_in_year.rb

Overview

This class is responsible for all the API calls related to expense vouchers.

Instance Method Summary collapse

Methods included from Helper::DateHelper

#build_date_string_for_api

Constructor Details

#initialize(expense_voucher_api) ⇒ ExpenseVouchersForMonthInYear

Returns a new instance of ExpenseVouchersForMonthInYear.



11
12
13
# File 'lib/papierkram_api/v1/business_intelligence/smart_queries/expense_vouchers_for_month_in_year.rb', line 11

def initialize(expense_voucher_api)
  @expense_voucher_api = expense_voucher_api
end

Instance Method Details

#for_month_in_year(year:, month:) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/papierkram_api/v1/business_intelligence/smart_queries/expense_vouchers_for_month_in_year.rb', line 15

def for_month_in_year(year:, month:)
  @year = year
  @month = month
  @start_date = Date.new(@year, @month, 1)
  @end_date = Date.new(@year, @month + 1, 1) - 1
  collect_expense_vouchers
end