Class: Nyaplot::DataBase

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializeDataBase

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