Sha256: 0c4d2794d477a7f055ed3a6e4116f89446c158c94c4744a60249f16adc856062

Contents?: true

Size: 483 Bytes

Versions: 5

Compression:

Stored size: 483 Bytes

Contents

# typed: strict
# frozen_string_literal: true

require_relative "../objects/user"

module LunchMoney
  module Calls
    # https://lunchmoney.dev/#user
    class Users < LunchMoney::Calls::Base
      sig { returns(T.any(LunchMoney::Objects::User, LunchMoney::Errors)) }
      def me
        response = get("me")

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

        LunchMoney::Objects::User.new(**response.body)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lunchmoney-1.4.0 lib/lunchmoney/calls/users.rb
lunchmoney-1.2.0 lib/lunchmoney/calls/users.rb
lunchmoney-1.1.2 lib/lunchmoney/calls/users.rb
lunchmoney-1.1.1 lib/lunchmoney/calls/users.rb
lunchmoney-1.1.0 lib/lunchmoney/calls/users.rb