Class: Tradier::History

Inherits:
Base
  • Object
show all
Defined in:
lib/tradier/history.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #attr_equal, attr_reader, #attrs, #attrs_equal, #initialize, #update

Constructor Details

This class inherits a constructor from Tradier::Base

Instance Attribute Details

#closeObject (readonly)

Returns the value of attribute close.



7
8
9
# File 'lib/tradier/history.rb', line 7

def close
  @close
end

#highObject (readonly)

Returns the value of attribute high.



7
8
9
# File 'lib/tradier/history.rb', line 7

def high
  @high
end

#lowObject (readonly)

Returns the value of attribute low.



7
8
9
# File 'lib/tradier/history.rb', line 7

def low
  @low
end

#openObject (readonly)

Returns the value of attribute open.



7
8
9
# File 'lib/tradier/history.rb', line 7

def open
  @open
end

#volumeObject (readonly)

Returns the value of attribute volume.



7
8
9
# File 'lib/tradier/history.rb', line 7

def volume
  @volume
end

Class Method Details

.from_response(body = {}) ⇒ Object



15
16
17
# File 'lib/tradier/history.rb', line 15

def self.from_response(body={})
  new(body)
end

Instance Method Details

#dateObject



9
10
11
12
13
# File 'lib/tradier/history.rb', line 9

def date
  return unless @date || @attrs[:date]

  @date ||= Date.parse(@attrs[:date])
end