Sha256: bcb7d99f328dc4e27f432d4ebbbc4cef78c58a9acdd2fab715f1ee9650d64c18

Contents?: true

Size: 465 Bytes

Versions: 2

Compression:

Stored size: 465 Bytes

Contents

# typed: strict
# frozen_string_literal: true

require_relative "tag/tag_base"
require_relative "tag/tag"

module LunchMoney
  # https://lunchmoney.dev/#tags
  class TagCalls < ApiCall
    sig { returns(T.any(T::Array[LunchMoney::Tag], LunchMoney::Errors)) }
    def tags
      response = get("tags")

      api_errors = errors(response)
      return api_errors if api_errors.present?

      response.body.map { |tag| LunchMoney::Tag.new(**tag) }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lunchmoney-1.0.0 lib/lunchmoney/tags/tag_calls.rb
lunchmoney-0.10.0 lib/lunchmoney/tags/tag_calls.rb