Module: StockMarkit

Defined in:
lib/stock-markit/version.rb,
lib/stock-markit.rb,
lib/stock-markit/chart.rb,
lib/stock-markit/quote.rb,
lib/stock-markit/stock.rb,
lib/stock-markit/lookup.rb,
lib/stock-markit/element.rb,
lib/stock-markit/chart_result.rb,
lib/stock-markit/api_exception.rb

Overview

Provides the Version Constant

Author

Michael Heijmans ([email protected])

Copyright

Copyright © 2016 Michael Heijmans

License

MIT

Defined Under Namespace

Classes: ApiException, Chart, ChartResult, Element, Lookup, Quote, Stock

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.lookup(symbol) ⇒ Array<StockMarkit::Stock>

Uses the lookup service to find stocks with the given symbol

Parameters:

  • symbol (String, Symbol)

    The ticker symbol to lookup

Returns:

See Also:



32
33
34
# File 'lib/stock-markit.rb', line 32

def self.lookup(symbol)
  Lookup.new(symbol).fetch
end

.quote(symbol) ⇒ StockMarkit::Quote

Uses the quote service to get a quote for the given symbol

Parameters:

  • symbol (String, Symbol)

    The ticker symbol to lookup

Returns:

See Also:



41
42
43
# File 'lib/stock-markit.rb', line 41

def self.quote(symbol)
  Quote.new(symbol).fetch
end

.require_lib(lib) ⇒ Object

require library file that was passed

Parameters:

  • lib (String)

    Library path to require



15
16
17
# File 'lib/stock-markit.rb', line 15

def self.require_lib(lib)
  require lib
end

.require_libs(libs) ⇒ Object

Iterates through the passed in array of library paths and requires each of them

Parameters:

  • libs (Array)

    Array of libraries to require



22
23
24
25
26
# File 'lib/stock-markit.rb', line 22

def self.require_libs(libs)
  libs.each do |lib|
    self.require_lib(lib)
  end
end