Class: SchwabRb::DataObjects::ProjectedBalances

Inherits:
Object
  • Object
show all
Defined in:
lib/schwab_rb/data_objects/account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(available_funds:, available_funds_non_marginable_trade:, buying_power:, day_trading_buying_power:, day_trading_buying_power_call:, maintenance_call:, reg_t_call:, is_in_call:, stock_buying_power:) ⇒ ProjectedBalances

Returns a new instance of ProjectedBalances.



210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/schwab_rb/data_objects/account.rb', line 210

def initialize(
  available_funds:, available_funds_non_marginable_trade:, buying_power:, day_trading_buying_power:,
  day_trading_buying_power_call:, maintenance_call:, reg_t_call:, is_in_call:, stock_buying_power:
)
  @available_funds = available_funds
  @available_funds_non_marginable_trade = available_funds_non_marginable_trade
  @buying_power = buying_power
  @day_trading_buying_power = day_trading_buying_power
  @day_trading_buying_power_call = day_trading_buying_power_call
  @maintenance_call = maintenance_call
  @reg_t_call = reg_t_call
  @is_in_call = is_in_call
  @stock_buying_power = stock_buying_power
end

Instance Attribute Details

#available_fundsObject (readonly)

Returns the value of attribute available_funds.



190
191
192
# File 'lib/schwab_rb/data_objects/account.rb', line 190

def available_funds
  @available_funds
end

#available_funds_non_marginable_tradeObject (readonly)

Returns the value of attribute available_funds_non_marginable_trade.



190
191
192
# File 'lib/schwab_rb/data_objects/account.rb', line 190

def available_funds_non_marginable_trade
  @available_funds_non_marginable_trade
end

#buying_powerObject (readonly)

Returns the value of attribute buying_power.



190
191
192
# File 'lib/schwab_rb/data_objects/account.rb', line 190

def buying_power
  @buying_power
end

#day_trading_buying_powerObject (readonly)

Returns the value of attribute day_trading_buying_power.



190
191
192
# File 'lib/schwab_rb/data_objects/account.rb', line 190

def day_trading_buying_power
  @day_trading_buying_power
end

#day_trading_buying_power_callObject (readonly)

Returns the value of attribute day_trading_buying_power_call.



190
191
192
# File 'lib/schwab_rb/data_objects/account.rb', line 190

def day_trading_buying_power_call
  @day_trading_buying_power_call
end

#is_in_callObject (readonly)

Returns the value of attribute is_in_call.



190
191
192
# File 'lib/schwab_rb/data_objects/account.rb', line 190

def is_in_call
  @is_in_call
end

#maintenance_callObject (readonly)

Returns the value of attribute maintenance_call.



190
191
192
# File 'lib/schwab_rb/data_objects/account.rb', line 190

def maintenance_call
  @maintenance_call
end

#reg_t_callObject (readonly)

Returns the value of attribute reg_t_call.



190
191
192
# File 'lib/schwab_rb/data_objects/account.rb', line 190

def reg_t_call
  @reg_t_call
end

#stock_buying_powerObject (readonly)

Returns the value of attribute stock_buying_power.



190
191
192
# File 'lib/schwab_rb/data_objects/account.rb', line 190

def stock_buying_power
  @stock_buying_power
end

Class Method Details

.build(data) ⇒ Object



195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/schwab_rb/data_objects/account.rb', line 195

def build(data)
  new(
    available_funds: data[:availableFunds],
    available_funds_non_marginable_trade: data[:availableFundsNonMarginableTrade],
    buying_power: data[:buyingPower],
    day_trading_buying_power: data[:dayTradingBuyingPower],
    day_trading_buying_power_call: data[:dayTradingBuyingPowerCall],
    maintenance_call: data[:maintenanceCall],
    reg_t_call: data[:regTCall],
    is_in_call: data[:isInCall],
    stock_buying_power: data[:stockBuyingPower]
  )
end