Class: Tradier::Clock
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#next_change ⇒ Object
readonly
Returns the value of attribute next_change.
-
#next_state ⇒ Object
readonly
Returns the value of attribute next_state.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
Methods inherited from Base
#[], #attr_equal, attr_reader, #attrs, #attrs_equal, from_response, #initialize, #update
Constructor Details
This class inherits a constructor from Tradier::Base
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/tradier/clock.rb', line 6 def description @description end |
#next_change ⇒ Object (readonly)
Returns the value of attribute next_change.
6 7 8 |
# File 'lib/tradier/clock.rb', line 6 def next_change @next_change end |
#next_state ⇒ Object (readonly)
Returns the value of attribute next_state.
6 7 8 |
# File 'lib/tradier/clock.rb', line 6 def next_state @next_state end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
6 7 8 |
# File 'lib/tradier/clock.rb', line 6 def state @state end |
Instance Method Details
#date ⇒ Object
8 9 10 11 12 |
# File 'lib/tradier/clock.rb', line 8 def date return unless @date || @attrs[:date] @date ||= Date.parse(@attrs[:date]) end |
#time ⇒ Object
14 15 16 17 18 |
# File 'lib/tradier/clock.rb', line 14 def time return unless @time || @attrs[:timestamp] @time ||= Time.at(@attrs[:timestamp].to_i) end |