Class: RubyUtils::DataRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_utils/data_repository.rb

Overview

This class serves as a data repository storing the read data and handling the meta information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meta_data) ⇒ DataRepository

initialization

Parameters:

  • meta_data (MetaData)

    the meta data for the data set



15
16
17
18
# File 'lib/ruby_utils/data_repository.rb', line 15

def initialize()
  @meta_data = 
  @repository = Array.new()
end

Instance Attribute Details

#meta_dataMetaData (readonly)

Returns the meta data of the dataset.

Returns:

  • (MetaData)

    the meta data of the dataset



9
10
11
# File 'lib/ruby_utils/data_repository.rb', line 9

def 
  @meta_data
end

#repositoryArray (readonly)

Returns an array containing all datasets.

Returns:

  • (Array)

    an array containing all datasets



11
12
13
# File 'lib/ruby_utils/data_repository.rb', line 11

def repository
  @repository
end

Instance Method Details

#add_data_entry(entry) ⇒ Object

reads the file and creates meta information and data of its content

Parameters:

  • entry (DataEntry)

    the data entry that should be added



22
23
24
25
# File 'lib/ruby_utils/data_repository.rb', line 22

def add_data_entry(entry)
  @repository << entry
  return nil
end