Class: Pluggy::Resources::StatusDetail

Inherits:
APIResource show all
Defined in:
lib/pluggy/resources/item.rb

Overview

Per-product sync state. Useful for answering "are the transactions ready yet?" without polling the whole item.

Constant Summary collapse

PRODUCTS =
%w[
  accounts creditCards transactions investments identity
  investmentsTransactions paymentData loans accountStatements
].freeze

Constants inherited from PluggyObject

PluggyObject::ISO8601, PluggyObject::RESERVED, PluggyObject::TEMPORAL_KEYS

Instance Attribute Summary

Attributes inherited from PluggyObject

#client

Instance Method Summary collapse

Methods inherited from PluggyObject

#==, #[], #as_json, declared_fields, define_field, #each_pair, fields, #hash, #initialize, #inspect, #key?, #keys, #method_missing, nested, nested_types, #read, #respond_to_missing?, #to_h, #to_json, #values

Constructor Details

This class inherits a constructor from Pluggy::PluggyObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Pluggy::PluggyObject

Instance Method Details

#updated?(product) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/pluggy/resources/item.rb', line 26

def updated?(product)
  self[Util.camel_case(product)]&.updated? || false
end

#warningsObject



30
31
32
# File 'lib/pluggy/resources/item.rb', line 30

def warnings
  PRODUCTS.flat_map { |p| self[p]&.warnings || [] }
end