Module: Tradier::API::Watchlists
Instance Method Summary collapse
-
#add_watchlist_item(id, options = {}) ⇒ Tradier::Watchlist
(also: #create_watchlist_item, #create_watchlist_symbol, #add_watchlist_symbol)
Update a watchlist symbol.
-
#create_watchlist(options = {}) ⇒ Tradier::Watchlist
Create a new watchlist.
-
#delete_watchlist(id, options = {}) ⇒ Boolean
Delete a watchlist.
-
#remove_watchlist_item(id, symbol, options = {}) ⇒ Tradier::Watchlist
(also: #delete_watchlist_item, #remove_watchlist_symbol, #delete_watchlist_symbol)
Remove a watchlist symbol.
-
#update_watchlist(id, options = {}) ⇒ Tradier::Watchlist
Update a watchlist.
-
#update_watchlist_item(id, symbol, options = {}) ⇒ Tradier::WatchlistItem
(also: #update_watchlist_symbol)
Update a watchlist symbol.
-
#watchlist(id, options = {}) ⇒ Tradier::Watchlist
Get a watchlist.
-
#watchlist_item(id, symbol, options = {}) ⇒ Tradier::WatchlistItem
(also: #watchlist_symbol)
Retrieve a watchlist symbol.
-
#watchlists(options = {}) ⇒ Array<Tradier::Watchlist>
Get all watchlists.
Instance Method Details
#add_watchlist_item(id, options = {}) ⇒ Tradier::Watchlist Also known as: create_watchlist_item, create_watchlist_symbol, add_watchlist_symbol
Update a watchlist symbol.
94 95 96 |
# File 'lib/tradier/api/watchlists.rb', line 94 def add_watchlist_item(id, ={}) object_from_response(Tradier::WatchlistItem, :post, "/watchlists/#{id}/symbols", ) end |
#create_watchlist(options = {}) ⇒ Tradier::Watchlist
Create a new watchlist.
51 52 53 |
# File 'lib/tradier/api/watchlists.rb', line 51 def create_watchlist(={}) object_from_response(Tradier::Watchlist, :post, '/watchlists', ) end |
#delete_watchlist(id, options = {}) ⇒ Boolean
Delete a watchlist.
38 39 40 |
# File 'lib/tradier/api/watchlists.rb', line 38 def delete_watchlist(id, ={}) send(:delete, "/watchlists/#{id}", )[:status] == 200 end |
#remove_watchlist_item(id, symbol, options = {}) ⇒ Tradier::Watchlist Also known as: delete_watchlist_item, remove_watchlist_symbol, delete_watchlist_symbol
Remove a watchlist symbol.
111 112 113 |
# File 'lib/tradier/api/watchlists.rb', line 111 def remove_watchlist_item(id, symbol, ={}) send(:delete, "/watchlists/#{id}/symbols/#{symbol}", )[:status] == 200 end |
#update_watchlist(id, options = {}) ⇒ Tradier::Watchlist
Update a watchlist.
65 66 67 |
# File 'lib/tradier/api/watchlists.rb', line 65 def update_watchlist(id, ={}) object_from_response(Tradier::Watchlist, :put, "/watchlists/#{id}", ) end |
#update_watchlist_item(id, symbol, options = {}) ⇒ Tradier::WatchlistItem Also known as: update_watchlist_symbol
Update a watchlist symbol.
132 133 134 |
# File 'lib/tradier/api/watchlists.rb', line 132 def update_watchlist_item(id, symbol, ={}) object_from_response(Tradier::WatchlistItem, :put, "/watchlists/#{id}/symbols/#{symbol}", ) end |
#watchlist(id, options = {}) ⇒ Tradier::Watchlist
Get a watchlist.
26 27 28 |
# File 'lib/tradier/api/watchlists.rb', line 26 def watchlist(id, ={}) object_from_response(Tradier::Watchlist, :get, "/watchlists/#{id}", ) end |
#watchlist_item(id, symbol, options = {}) ⇒ Tradier::WatchlistItem Also known as: watchlist_symbol
Retrieve a watchlist symbol.
78 79 80 |
# File 'lib/tradier/api/watchlists.rb', line 78 def watchlist_item(id, symbol, ={}) object_from_response(Tradier::WatchlistItem, :get, "/watchlists/#{id}/symbols/#{symbol}", ) end |
#watchlists(options = {}) ⇒ Array<Tradier::Watchlist>
Get all watchlists.
14 15 16 |
# File 'lib/tradier/api/watchlists.rb', line 14 def watchlists(={}) response = object_from_response(Tradier::API::Utils::Watchlist, :get, '/watchlists', ).body end |