Class: Trainers::Dataset
- Inherits:
-
Object
- Object
- Trainers::Dataset
- Includes:
- Enumerable
- Defined in:
- lib/trainers/data/dataset.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #[](index) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(data) ⇒ Dataset
constructor
A new instance of Dataset.
- #size ⇒ Object (also: #length)
Constructor Details
#initialize(data) ⇒ Dataset
Returns a new instance of Dataset.
9 10 11 |
# File 'lib/trainers/data/dataset.rb', line 9 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/trainers/data/dataset.rb', line 7 def data @data end |
Instance Method Details
#[](index) ⇒ Object
13 14 15 |
# File 'lib/trainers/data/dataset.rb', line 13 def [](index) @data[index] end |
#each(&block) ⇒ Object
22 23 24 |
# File 'lib/trainers/data/dataset.rb', line 22 def each(&block) @data.each(&block) end |
#size ⇒ Object Also known as: length
17 18 19 |
# File 'lib/trainers/data/dataset.rb', line 17 def size @data.size end |