Class: Ishapi::OptionPriceItemsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ishapi/option_price_items_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#exception, #home, #long_term_token, #vote

Instance Method Details

#viewObject

params: symbol, begin_at, end_at



10
11
12
13
14
15
# File 'app/controllers/ishapi/option_price_items_controller.rb', line 10

def view
  authorize! :view_chain, ::Iro::OptionPriceItem.new
  @opis = ::Iro::OptionPriceItem.where({ ticker: params[:symbol]
  }).where( "timestamp BETWEEN ? and ? ", params[:begin_at], params[:end_at]
  ).limit(100)
end

#view_by_symbolObject



17
18
19
20
21
22
# File 'app/controllers/ishapi/option_price_items_controller.rb', line 17

def view_by_symbol
  authorize! :view_chain, ::Iro::OptionPriceItem.new
  @opis = ::Iro::OptionPriceItem.where({ symbol: params[:symbol]
  }).limit(100)
  render 'view'
end