Class: Radar::API::IndexService::Client

Inherits:
Object
  • Object
show all
Includes:
Thrift::Client
Defined in:
lib/radar/api/index_service.rb

Instance Method Summary collapse

Instance Method Details

#price(symbol, date) ⇒ Object



31
32
33
34
# File 'lib/radar/api/index_service.rb', line 31

def price(symbol, date)
  send_price(symbol, date)
  return recv_price()
end

#price_change(symbol, start_date, end_date) ⇒ Object



46
47
48
49
# File 'lib/radar/api/index_service.rb', line 46

def price_change(symbol, start_date, end_date)
  send_price_change(symbol, start_date, end_date)
  return recv_price_change()
end

#prices(symbol, start_date, end_date) ⇒ Object



16
17
18
19
# File 'lib/radar/api/index_service.rb', line 16

def prices(symbol, start_date, end_date)
  send_prices(symbol, start_date, end_date)
  return recv_prices()
end

#recv_priceObject

Raises:



40
41
42
43
44
# File 'lib/radar/api/index_service.rb', line 40

def recv_price()
  result = receive_message(Price_result)
  return result.success unless result.success.nil?
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'price failed: unknown result')
end

#recv_price_changeObject

Raises:



55
56
57
58
59
# File 'lib/radar/api/index_service.rb', line 55

def recv_price_change()
  result = receive_message(Price_change_result)
  return result.success unless result.success.nil?
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'price_change failed: unknown result')
end

#recv_pricesObject

Raises:



25
26
27
28
29
# File 'lib/radar/api/index_service.rb', line 25

def recv_prices()
  result = receive_message(Prices_result)
  return result.success unless result.success.nil?
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'prices failed: unknown result')
end

#send_price(symbol, date) ⇒ Object



36
37
38
# File 'lib/radar/api/index_service.rb', line 36

def send_price(symbol, date)
  send_message('price', Price_args, :symbol => symbol, :date => date)
end

#send_price_change(symbol, start_date, end_date) ⇒ Object



51
52
53
# File 'lib/radar/api/index_service.rb', line 51

def send_price_change(symbol, start_date, end_date)
  send_message('price_change', Price_change_args, :symbol => symbol, :start_date => start_date, :end_date => end_date)
end

#send_prices(symbol, start_date, end_date) ⇒ Object



21
22
23
# File 'lib/radar/api/index_service.rb', line 21

def send_prices(symbol, start_date, end_date)
  send_message('prices', Prices_args, :symbol => symbol, :start_date => start_date, :end_date => end_date)
end