Class: QuestradeApi::REST::Time

Inherits:
Base
  • Object
show all
Defined in:
lib/questrade_api/rest/time.rb

Overview

Author:

Constant Summary

Constants inherited from Base

Base::BASE_ENDPOINT

Instance Attribute Summary

Attributes inherited from Base

#account_id, #authorization, #connection, #data, #endpoint, #id, #raw_body

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#build_attributes, #build_data, connection, fetch, post, #url

Constructor Details

#initialize(authorization) ⇒ Time

Returns a new instance of Time.



7
8
9
# File 'lib/questrade_api/rest/time.rb', line 7

def initialize(authorization)
  super(authorization)
end

Class Method Details

.endpointObject



23
24
25
# File 'lib/questrade_api/rest/time.rb', line 23

def self.endpoint
  "#{BASE_ENDPOINT}/time"
end

Instance Method Details

#fetchObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/questrade_api/rest/time.rb', line 11

def fetch
  response = super

  if raw_body
    build_data(raw_body)
    data.time = DateTime.parse(data.time)
    response = data.time
  end

  response
end