Class: SchwabRb::DataObjects::IndexQuote
- Inherits:
-
Object
- Object
- SchwabRb::DataObjects::IndexQuote
- Defined in:
- lib/schwab_rb/data_objects/quote.rb
Instance Attribute Summary collapse
-
#asset_main_type ⇒ Object
readonly
Returns the value of attribute asset_main_type.
-
#avg_10_days_volume ⇒ Object
readonly
Returns the value of attribute avg_10_days_volume.
-
#avg_1_year_volume ⇒ Object
readonly
Returns the value of attribute avg_1_year_volume.
-
#close_price ⇒ Object
readonly
Returns the value of attribute close_price.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#div_amount ⇒ Object
readonly
Returns the value of attribute div_amount.
-
#div_freq ⇒ Object
readonly
Returns the value of attribute div_freq.
-
#div_pay_amount ⇒ Object
readonly
Returns the value of attribute div_pay_amount.
-
#div_yield ⇒ Object
readonly
Returns the value of attribute div_yield.
-
#eps ⇒ Object
readonly
Returns the value of attribute eps.
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#exchange_name ⇒ Object
readonly
Returns the value of attribute exchange_name.
-
#fund_leverage_factor ⇒ Object
readonly
Returns the value of attribute fund_leverage_factor.
-
#high_price ⇒ Object
readonly
Returns the value of attribute high_price.
-
#last_price ⇒ Object
readonly
Returns the value of attribute last_price.
-
#low_price ⇒ Object
readonly
Returns the value of attribute low_price.
-
#net_change ⇒ Object
readonly
Returns the value of attribute net_change.
-
#net_percent_change ⇒ Object
readonly
Returns the value of attribute net_percent_change.
-
#open_price ⇒ Object
readonly
Returns the value of attribute open_price.
-
#pe_ratio ⇒ Object
readonly
Returns the value of attribute pe_ratio.
-
#quote_52_week_high ⇒ Object
readonly
Returns the value of attribute quote_52_week_high.
-
#quote_52_week_low ⇒ Object
readonly
Returns the value of attribute quote_52_week_low.
-
#realtime ⇒ Object
readonly
Returns the value of attribute realtime.
-
#security_status ⇒ Object
readonly
Returns the value of attribute security_status.
-
#ssid ⇒ Object
readonly
Returns the value of attribute ssid.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#total_volume ⇒ Object
readonly
Returns the value of attribute total_volume.
-
#trade_time ⇒ Object
readonly
Returns the value of attribute trade_time.
Instance Method Summary collapse
-
#initialize(data) ⇒ IndexQuote
constructor
A new instance of IndexQuote.
- #mark ⇒ Object
Constructor Details
#initialize(data) ⇒ IndexQuote
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 105 def initialize(data) @symbol = data[:symbol] @asset_main_type = data[:assetMainType] @realtime = data[:realtime] @ssid = data[:ssid] @avg_10_days_volume = data.dig(:fundamental, :avg10DaysVolume) @avg_1_year_volume = data.dig(:fundamental, :avg1YearVolume) @div_amount = data.dig(:fundamental, :divAmount) @div_freq = data.dig(:fundamental, :divFreq) @div_pay_amount = data.dig(:fundamental, :divPayAmount) @div_yield = data.dig(:fundamental, :divYield) @eps = data.dig(:fundamental, :eps) @fund_leverage_factor = data.dig(:fundamental, :fundLeverageFactor) @pe_ratio = data.dig(:fundamental, :peRatio) @quote_52_week_high = data.dig(:quote, :"52WeekHigh") @quote_52_week_low = data.dig(:quote, :"52WeekLow") @close_price = data.dig(:quote, :closePrice) @high_price = data.dig(:quote, :highPrice) @last_price = data.dig(:quote, :lastPrice) @low_price = data.dig(:quote, :lowPrice) @net_change = data.dig(:quote, :netChange) @net_percent_change = data.dig(:quote, :netPercentChange) @open_price = data.dig(:quote, :openPrice) @security_status = data.dig(:quote, :securityStatus) @total_volume = data.dig(:quote, :totalVolume) @trade_time = data.dig(:quote, :tradeTime) @description = data.dig(:reference, :description) @exchange = data.dig(:reference, :exchange) @exchange_name = data.dig(:reference, :exchangeName) end |
Instance Attribute Details
#asset_main_type ⇒ Object (readonly)
Returns the value of attribute asset_main_type.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def asset_main_type @asset_main_type end |
#avg_10_days_volume ⇒ Object (readonly)
Returns the value of attribute avg_10_days_volume.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def avg_10_days_volume @avg_10_days_volume end |
#avg_1_year_volume ⇒ Object (readonly)
Returns the value of attribute avg_1_year_volume.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def avg_1_year_volume @avg_1_year_volume end |
#close_price ⇒ Object (readonly)
Returns the value of attribute close_price.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def close_price @close_price end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def description @description end |
#div_amount ⇒ Object (readonly)
Returns the value of attribute div_amount.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def div_amount @div_amount end |
#div_freq ⇒ Object (readonly)
Returns the value of attribute div_freq.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def div_freq @div_freq end |
#div_pay_amount ⇒ Object (readonly)
Returns the value of attribute div_pay_amount.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def div_pay_amount @div_pay_amount end |
#div_yield ⇒ Object (readonly)
Returns the value of attribute div_yield.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def div_yield @div_yield end |
#eps ⇒ Object (readonly)
Returns the value of attribute eps.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def eps @eps end |
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def exchange @exchange end |
#exchange_name ⇒ Object (readonly)
Returns the value of attribute exchange_name.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def exchange_name @exchange_name end |
#fund_leverage_factor ⇒ Object (readonly)
Returns the value of attribute fund_leverage_factor.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def fund_leverage_factor @fund_leverage_factor end |
#high_price ⇒ Object (readonly)
Returns the value of attribute high_price.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def high_price @high_price end |
#last_price ⇒ Object (readonly)
Returns the value of attribute last_price.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def last_price @last_price end |
#low_price ⇒ Object (readonly)
Returns the value of attribute low_price.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def low_price @low_price end |
#net_change ⇒ Object (readonly)
Returns the value of attribute net_change.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def net_change @net_change end |
#net_percent_change ⇒ Object (readonly)
Returns the value of attribute net_percent_change.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def net_percent_change @net_percent_change end |
#open_price ⇒ Object (readonly)
Returns the value of attribute open_price.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def open_price @open_price end |
#pe_ratio ⇒ Object (readonly)
Returns the value of attribute pe_ratio.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def pe_ratio @pe_ratio end |
#quote_52_week_high ⇒ Object (readonly)
Returns the value of attribute quote_52_week_high.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def quote_52_week_high @quote_52_week_high end |
#quote_52_week_low ⇒ Object (readonly)
Returns the value of attribute quote_52_week_low.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def quote_52_week_low @quote_52_week_low end |
#realtime ⇒ Object (readonly)
Returns the value of attribute realtime.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def realtime @realtime end |
#security_status ⇒ Object (readonly)
Returns the value of attribute security_status.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def security_status @security_status end |
#ssid ⇒ Object (readonly)
Returns the value of attribute ssid.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def ssid @ssid end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def symbol @symbol end |
#total_volume ⇒ Object (readonly)
Returns the value of attribute total_volume.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def total_volume @total_volume end |
#trade_time ⇒ Object (readonly)
Returns the value of attribute trade_time.
102 103 104 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 102 def trade_time @trade_time end |
Instance Method Details
#mark ⇒ Object
136 137 138 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 136 def mark (@high_price + @low_price) / 2.0 end |