Class: MoexIss::Market::Stocks
- Inherits:
-
Object
- Object
- MoexIss::Market::Stocks
- Includes:
- Enumerable
- Defined in:
- lib/moex_iss/market/stocks.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #create_instances_stock ⇒ Object
- #each ⇒ Object
-
#initialize(response) ⇒ Stocks
constructor
A new instance of Stocks.
Constructor Details
#initialize(response) ⇒ Stocks
Returns a new instance of Stocks.
10 11 12 13 14 15 |
# File 'lib/moex_iss/market/stocks.rb', line 10 def initialize(response) @response = response @stocks_map = {} create_instances_stock end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
8 9 10 |
# File 'lib/moex_iss/market/stocks.rb', line 8 def response @response end |
Instance Method Details
#create_instances_stock ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/moex_iss/market/stocks.rb', line 17 def create_instances_stock @response.each do |data| method = data["securities"]["SECID"].downcase.to_sym setup_method(method, data) end end |
#each ⇒ Object
25 26 27 |
# File 'lib/moex_iss/market/stocks.rb', line 25 def each @stocks_map.values.each { |stock| yield stock } end |