Class: Plaid::Income::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/plaid/income.rb

Overview

Public: The class encapsulating an income stream.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fields) ⇒ Stream

Internal: Initialize a Stream.

fields - The Hash with fields (keys are Strings).



26
27
28
29
30
31
# File 'lib/plaid/income.rb', line 26

def initialize(fields)
  @monthly_income = fields['monthly_income']
  @confidence = fields['confidence']
  @days = fields['days']
  @name = fields['name']
end

Instance Attribute Details

#confidenceObject (readonly)

Public: The Float representation of Plaid’s confidence in the income data associated with this particular income stream, with 0 being the lowest confidence and 1 being the highest. E.g. 0.9.



13
14
15
# File 'lib/plaid/income.rb', line 13

def confidence
  @confidence
end

#daysObject (readonly)

Public: The Integer extent of data found for this income stream. E.g. 314.



17
18
19
# File 'lib/plaid/income.rb', line 17

def days
  @days
end

#monthly_incomeObject (readonly)

Public: The Float monthly income associated with the income stream. E.g. 5700.



8
9
10
# File 'lib/plaid/income.rb', line 8

def monthly_income
  @monthly_income
end

#nameObject (readonly)

Public: The String name of the entity associated with this income stream. E.g. “APPLE INC”.



21
22
23
# File 'lib/plaid/income.rb', line 21

def name
  @name
end

Instance Method Details

#inspectObject Also known as: to_s

Public: Get a String representation of the Stream.

Returns a String.



36
37
38
39
40
41
# File 'lib/plaid/income.rb', line 36

def inspect
  "#<Plaid::Income::Stream name=#{name.inspect}, " \
    "monthly_income=#{monthly_income.inspect}, " \
    "confidence=#{confidence.inspect}, " \
    "days=#{days.inspect}>"
end