Class: Portfolio::Store

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/portfolio/store.rb

Instance Method Summary collapse

Instance Method Details

#portfolioObject



19
20
21
22
# File 'lib/portfolio/store.rb', line 19

def portfolio
  datastore = get_datastore
  datastore['portfolio']
end

#portfolio=(portfolio) ⇒ Object



24
25
26
27
28
# File 'lib/portfolio/store.rb', line 24

def portfolio=(portfolio)
  data = get_datastore()
  data['portfolio'] = portfolio
  save_datastore(data)
end

#watched_stocksObject



8
9
10
11
# File 'lib/portfolio/store.rb', line 8

def watched_stocks
  datastore = get_datastore
  datastore['watched_stocks']
end

#watched_stocks=(watched_stocks) ⇒ Object



13
14
15
16
17
# File 'lib/portfolio/store.rb', line 13

def watched_stocks=(watched_stocks)
  data = get_datastore()
  data['watched_stocks'] = watched_stocks
  save_datastore(data)
end