Class: Dphil::LDDataSet

Inherits:
Object
  • Object
show all
Includes:
LDOutput
Defined in:
lib/dphil/ld_data_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LDOutput

#as_jsonld, #to_jsonld

Constructor Details

#initialize(matrix:, trees:) ⇒ LDDataSet

Returns a new instance of LDDataSet.



9
10
11
12
# File 'lib/dphil/ld_data_set.rb', line 9

def initialize(matrix:, trees:)
  @matrix = matrix
  @trees = trees
end

Instance Attribute Details

#matrixObject (readonly)

Returns the value of attribute matrix.



7
8
9
# File 'lib/dphil/ld_data_set.rb', line 7

def matrix
  @matrix
end

#treesObject (readonly)

Returns the value of attribute trees.



7
8
9
# File 'lib/dphil/ld_data_set.rb', line 7

def trees
  @trees
end

Instance Method Details

#as_json(options = nil) ⇒ Object



21
22
23
# File 'lib/dphil/ld_data_set.rb', line 21

def as_json(options = nil)
  to_h.as_json(options)
end

#to_hObject



14
15
16
17
18
19
# File 'lib/dphil/ld_data_set.rb', line 14

def to_h
  {
    matrix: matrix,
    trees: trees,
  }
end