Sha256: 6f90a55284342361aa1ec016543a4c6b0db4371ff88344b7f4369b3f1cbf9aff

Contents?: true

Size: 356 Bytes

Versions: 7

Compression:

Stored size: 356 Bytes

Contents

require 'singleton'

module Nyaplot

  # DataBase to store instance of Nyaplot::DataFrame
  # Each dataframe will be fetched when Nyaplot::Frame#to_json is excuted
  class DataBase
    include Singleton

    def initialize
      @db = {}
    end

    def add(df)
      @db[df.name] = df
    end

    def fetch(df_name)
      @db[df_name]
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nyaplot-0.1.6 lib/nyaplot/database.rb
nyaplot-0.1.5 lib/nyaplot/database.rb
nyaplot-0.1.4 lib/nyaplot/database.rb
nyaplot-0.1.3 lib/nyaplot/database.rb
nyaplot-0.1.2 lib/nyaplot/database.rb
nyaplot-0.1.1 lib/nyaplot/database.rb
nyaplot-0.1.0 lib/nyaplot/database.rb