Module: Yfinrb::Holders
Constant Summary collapse
- BASE_URL =
include YfConnection
'https://query2.finance.yahoo.com'.freeze
- QUOTE_SUMMARY_URL =
"#{BASE_URL}/v10/finance/quoteSummary/".freeze
Class Method Summary collapse
-
.included(base) ⇒ Object
attr_accessor :ticker.
Instance Method Summary collapse
- #initialize_holders ⇒ Object
- #insider_purchases ⇒ Object
- #insider_roster ⇒ Object (also: #insider_roster_holders)
- #insider_transactions ⇒ Object
- #institutional ⇒ Object (also: #institutional_holders)
- #major ⇒ Object (also: #major_holders)
- #mutualfund ⇒ Object (also: #mutualfund_holders)
Class Method Details
.included(base) ⇒ Object
attr_accessor :ticker
11 12 13 14 15 16 17 18 19 |
# File 'lib/yfinrb/holders.rb', line 11 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_holders # (your module code here) end end end |
Instance Method Details
#initialize_holders ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/yfinrb/holders.rb', line 21 def initialize_holders @major = nil @major_direct_holders = nil @institutional = nil @mutualfund = nil @insider_transactions = nil @insider_purchases = nil @insider_roster = nil end |
#insider_purchases ⇒ Object
58 59 60 61 |
# File 'lib/yfinrb/holders.rb', line 58 def insider_purchases _fetch_and_parse if @insider_purchases.nil? return @insider_purchases end |
#insider_roster ⇒ Object Also known as: insider_roster_holders
63 64 65 66 67 68 |
# File 'lib/yfinrb/holders.rb', line 63 def insider_roster return @insider_roster unless @insider_roster.nil? _fetch_and_parse return @insider_roster end |
#insider_transactions ⇒ Object
53 54 55 56 |
# File 'lib/yfinrb/holders.rb', line 53 def insider_transactions _fetch_and_parse if @insider_transactions.nil? return @insider_transactions end |
#institutional ⇒ Object Also known as: institutional_holders
39 40 41 42 |
# File 'lib/yfinrb/holders.rb', line 39 def institutional _fetch_and_parse if @institutional.nil? return @institutional end |
#major ⇒ Object Also known as: major_holders
32 33 34 35 |
# File 'lib/yfinrb/holders.rb', line 32 def major _fetch_and_parse if @major.nil? return @major end |
#mutualfund ⇒ Object Also known as: mutualfund_holders
46 47 48 49 |
# File 'lib/yfinrb/holders.rb', line 46 def mutualfund _fetch_and_parse if @mutualfund.nil? return @mutualfund end |