Class: Nyaplot::DataBase
- Inherits:
-
Object
- Object
- Nyaplot::DataBase
- Includes:
- Singleton
- Defined in:
- lib/nyaplot/database.rb
Overview
DataBase to store instance of Nyaplot::DataFrame Each dataframe will be fetched when Nyaplot::Frame#to_json is excuted
Instance Method Summary collapse
- #add(df) ⇒ Object
- #fetch(df_name) ⇒ Object
-
#initialize ⇒ DataBase
constructor
A new instance of DataBase.
Constructor Details
#initialize ⇒ DataBase
Returns a new instance of DataBase.
10 11 12 |
# File 'lib/nyaplot/database.rb', line 10 def initialize @db = {} end |
Instance Method Details
#add(df) ⇒ Object
14 15 16 |
# File 'lib/nyaplot/database.rb', line 14 def add(df) @db[df.name] = df end |
#fetch(df_name) ⇒ Object
18 19 20 |
# File 'lib/nyaplot/database.rb', line 18 def fetch(df_name) @db[df_name] end |