Class: Portfolio::Store
- Inherits:
-
Object
- Object
- Portfolio::Store
- Includes:
- Singleton
- Defined in:
- lib/portfolio/store.rb
Instance Method Summary collapse
- #portfolio ⇒ Object
- #portfolio=(portfolio) ⇒ Object
- #watched_stocks ⇒ Object
- #watched_stocks=(watched_stocks) ⇒ Object
Instance Method Details
#portfolio ⇒ Object
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_stocks ⇒ Object
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 |