Class: Fugle::Intraday::Chart::Item Private
- Inherits:
-
Object
- Object
- Fugle::Intraday::Chart::Item
- Defined in:
- lib/fugle/intraday/chart.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #close ⇒ Object readonly private
- #high ⇒ Object readonly private
- #low ⇒ Object readonly private
- #open ⇒ Object readonly private
- #time ⇒ Object readonly private
- #unit ⇒ Object readonly private
- #volume ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(attributes, time) ⇒ Item
constructor
private
A new instance of Item.
-
#to_h ⇒ Hash
private
Convert to Hash.
-
#to_json(*args) ⇒ String
private
Convert to JSON.
Constructor Details
#initialize(attributes, time) ⇒ Item
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Item.
51 52 53 54 55 56 |
# File 'lib/fugle/intraday/chart.rb', line 51 def initialize(attributes, time) @time = DateTime.parse(time) attributes.each do |name, value| instance_variable_set("@#{name}", value) end end |
Instance Attribute Details
#close ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/fugle/intraday/chart.rb', line 47 def close @close end |
#high ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/fugle/intraday/chart.rb', line 47 def high @high end |
#low ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/fugle/intraday/chart.rb', line 47 def low @low end |
#open ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/fugle/intraday/chart.rb', line 47 def open @open end |
#time ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/fugle/intraday/chart.rb', line 47 def time @time end |
#unit ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/fugle/intraday/chart.rb', line 47 def unit @unit end |
#volume ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/fugle/intraday/chart.rb', line 47 def volume @volume end |
Instance Method Details
#to_h ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Convert to Hash
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/fugle/intraday/chart.rb', line 64 def to_h { open: @open, high: @high, low: @low, close: @close, unit: @unit, volume: @volume, time: @time } end |
#to_json(*args) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Convert to JSON
82 83 84 |
# File 'lib/fugle/intraday/chart.rb', line 82 def to_json(*args) to_h.to_json(*args) end |