class StockMarkit::Element
@attr_reader [String] symbol The Stock
Symbol @attr_reader [String] type The type of element. Must be one of :price, :volume, or :sma @attr_reader [String] params Params vary for each Type. The following Types accept Params. For the other types, Params should be null or an empty array. “sma”: [period], “price”: [“ohlc”] for open/high/low/close, [“c”] for close only.
@author Michael Heijmans (parabuzzle@gmail.com)
- Copyright
-
Copyright © 2016 Michael Heijmans
- License
-
MIT
Attributes
Public Class Methods
@param [String] symbol The stock's ticker symbol @param [Symbol] type The type of element. Must be one of :price, :volume, or :sma @param [Array] params Params vary for each Type. The following Types accept Params. For the other types, Params should be null or an empty array. “sma”: [period], “price”: [“ohlc”] for open/high/low/close, [“c”] for close only.
# File lib/stock-markit/element.rb, line 19 def initialize(symbol, type, params=nil) @symbol = symbol.to_s.upcase @type = type.to_s @params = params || default_params end
Private Instance Methods
# File lib/stock-markit/element.rb, line 27 def default_params case @type when "price" "c" when "sma" :week end end