Module: Yfinrb::Analysis

Extended by:
ActiveSupport::Concern
Included in:
Ticker
Defined in:
lib/yfinrb/analysis.rb

Class Method Summary collapse

Instance Method Summary collapse

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_targetObject 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_detailsObject 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_trendObject

(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_estObject 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_analysisObject



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_estObject 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