Sha256: 0b88cb19871e7ea8d51f7f36206d488b6fd9d77487bf595e66fcd3218e549c1a

Contents?: true

Size: 1.52 KB

Versions: 2

Compression:

Stored size: 1.52 KB

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    module Models
      class WalletJournalEntry < Base
        def as_json
          {
            amount: amount,
            balance: balance,
            context_id: context_id,
            context_id_type: context_id_type,
            date: date,
            description: description,
            first_party_id: first_party_id,
            id: id,
            reason: reason,
            ref_type: ref_type,
            second_party_id: second_party_id,
            tax: tax,
            tax_receiver_id: tax_receiver_id,
          }
        end

        def amount
          options["amount"]
        end

        def balance
          options["balance"]
        end

        def context_id
          options["context_id"]
        end

        def context_id_type
          options["context_id_type"]
        end

        def date
          date = options["date"]

          parse_datetime_with_timezone(date) if date
        end

        def description
          options["description"]
        end

        def first_party_id
          options["first_party_id"]
        end

        def id
          options["id"]
        end

        def reason
          options["reason"]
        end

        def ref_type
          options["ref_type"]
        end

        def second_party_id
          options["second_party_id"]
        end

        def tax
          options["tax"]
        end

        def tax_receiver_id
          options["tax_receiver_id"]
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eve_online-0.31.0 lib/eve_online/esi/models/wallet_journal_entry.rb
eve_online-0.30.0 lib/eve_online/esi/models/wallet_journal_entry.rb