Class: Remi::DataSource::DataFrame

Inherits:
Remi::DataSubject show all
Includes:
DataStub, Remi::DataSubject::DataSource
Defined in:
lib/remi/cucumber/data_source.rb,
lib/remi/data_subject/data_frame.rb

Instance Attribute Summary

Attributes inherited from Remi::DataSubject

#fields

Instance Method Summary collapse

Methods included from Remi::DataSubject::DataSource

#df, #extract

Methods included from DataStub

#empty_stub_df, #stub_df, #stub_row_array, #stub_values

Methods inherited from Remi::DataSubject

#df, #df=, #field_symbolizer

Constructor Details

#initialize(*args, **kargs, &block) ⇒ DataFrame

Returns a new instance of DataFrame.



6
7
8
9
# File 'lib/remi/data_subject/data_frame.rb', line 6

def initialize(*args, **kargs, &block)
  super
  init_df(*args, **kargs, &block)
end

Instance Method Details

#extract!Object

Public: Called to extract data from the source.

Returns data in a format that can be used to create a dataframe.



14
15
16
# File 'lib/remi/data_subject/data_frame.rb', line 14

def extract!
  @extract = @data.transpose
end

#to_dataframeObject

Public: Converts extracted data to a dataframe

Returns a Remi::DataFrame



21
22
23
# File 'lib/remi/data_subject/data_frame.rb', line 21

def to_dataframe
  DataFrame.create(@remi_df_type, extract, order: @fields.keys)
end