Class: StockMarkit::ChartResult

Inherits:
Object
  • Object
show all
Defined in:
lib/stock-markit/chart_result.rb

Overview

Stock Chart Result Object

Copyright

Copyright © 2016 Michael Heijmans

License

MIT

Author:

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ChartResult


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

def initialize(json)
  @json = json
end

Instance Method Details

#datesArray


29
30
31
# File 'lib/stock-markit/chart_result.rb', line 29

def dates
  @json["Dates"].map { |date| parse_date(date) }
end

#elementsArray


34
35
36
# File 'lib/stock-markit/chart_result.rb', line 34

def elements
  @json["Elements"]
end

#labelsHash


19
20
21
# File 'lib/stock-markit/chart_result.rb', line 19

def labels
  @json["Labels"]
end

#positionsArray


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

def positions
  @json["Positions"]
end