Module: Yfinrb::Analysis
Class Method Summary collapse
-
.included(base) ⇒ Object
attr_accessor :ticker.
Instance Method Summary collapse
-
#analyst_price_target ⇒ Object
(also: #price_targets)
(self).
-
#analyst_trend_details ⇒ Object
(also: #trend_details)
(self).
-
#earnings_trend ⇒ Object
(self).
-
#eps_est ⇒ Object
(also: #earnings_forecast)
(self).
- #initialize_analysis ⇒ Object
-
#rev_est ⇒ Object
(also: #rev_forecast)
(self).
Class Method Details
.included(base) ⇒ Object
attr_accessor :ticker
7 8 9 10 11 12 13 14 15 |
# File 'lib/yfinrb/analysis.rb', line 7 def self.included(base) # built-in Ruby hook for modules base.class_eval do original_method = instance_method(:initialize) define_method(:initialize) do |*args, &block| original_method.bind(self).call(*args, &block) initialize_analysis # (your module code here) end end end |
Instance Method Details
#analyst_price_target ⇒ Object Also known as: price_targets
(self)
38 39 40 41 |
# File 'lib/yfinrb/analysis.rb', line 38 def analyst_price_target #(self) raise YFNotImplementedError.new('analyst_price_target') if @analyst_price_target.nil? return analyst_price_target end |
#analyst_trend_details ⇒ Object Also known as: trend_details
(self)
31 32 33 34 |
# File 'lib/yfinrb/analysis.rb', line 31 def analyst_trend_details #(self) raise YFNotImplementedError.new('analyst_trend_details') if @analyst_trend_details.nil? return analyst_trend_details end |
#earnings_trend ⇒ Object
(self)
26 27 28 29 |
# File 'lib/yfinrb/analysis.rb', line 26 def earnings_trend #(self) raise YFNotImplementedError.new('earnings_trend') if @earnings_trend.nil? return earnings_trend end |
#eps_est ⇒ Object Also known as: earnings_forecast
(self)
52 53 54 55 |
# File 'lib/yfinrb/analysis.rb', line 52 def eps_est #(self) raise YFNotImplementedError.new('eps_est') if @eps_est.nil? return eps_est end |
#initialize_analysis ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/yfinrb/analysis.rb', line 17 def initialize_analysis @earnings_trend = nil @analyst_trend_details = nil @analyst_price_target = nil @ev_est = nil @ps_est = nil end |
#rev_est ⇒ Object Also known as: rev_forecast
(self)
45 46 47 48 |
# File 'lib/yfinrb/analysis.rb', line 45 def rev_est #(self) raise YFNotImplementedError.new('rev_est') if @rev_est.nil? return rev_est end |