Class: ModernTreasury::Resources::JournalEntries

Inherits:
Object
  • Object
show all
Defined in:
lib/modern_treasury/resources/journal_entries.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ JournalEntries

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of JournalEntries.

Parameters:



55
56
57
# File 'lib/modern_treasury/resources/journal_entries.rb', line 55

def initialize(client:)
  @client = client
end

Instance Method Details

#list(journal_report_id: , page: nil, per_page: nil, request_options: {}) ⇒ nil

Retrieve a list of journal entries

Parameters:

  • journal_report_id (String)

    The ID of the journal report

  • page (Integer)

    Page number for pagination

  • per_page (Integer)

    Number of items per page

  • request_options (ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



41
42
43
44
45
46
47
48
49
50
# File 'lib/modern_treasury/resources/journal_entries.rb', line 41

def list(params)
  parsed, options = ModernTreasury::JournalEntryListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/journal_entries",
    query: parsed,
    model: NilClass,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ nil

Retrieve a specific journal entry

Parameters:

Returns:

  • (nil)

See Also:



17
18
19
20
21
22
23
24
# File 'lib/modern_treasury/resources/journal_entries.rb', line 17

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["api/journal_entries/%1$s", id],
    model: NilClass,
    options: params[:request_options]
  )
end