Class: Pairwise::InputData
- Inherits:
-
Object
- Object
- Pairwise::InputData
- Defined in:
- lib/pairwise/input_data.rb
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(inputs) ⇒ InputData
constructor
A new instance of InputData.
- #labels ⇒ Object
Constructor Details
#initialize(inputs) ⇒ InputData
Returns a new instance of InputData.
4 5 6 |
# File 'lib/pairwise/input_data.rb', line 4 def initialize(inputs) @inputs = inputs.is_a?(Hash) ? hash_inputs_to_list(inputs) : inputs end |
Instance Method Details
#data ⇒ Object
8 9 10 |
# File 'lib/pairwise/input_data.rb', line 8 def data @data ||= @inputs.map {|input| input.values[0]} end |
#labels ⇒ Object
12 13 14 |
# File 'lib/pairwise/input_data.rb', line 12 def labels @labels ||= @inputs.map{|input| input.keys}.flatten end |