Class: Remi::DataSource
- Inherits:
-
DataSubject
- Object
- DataSubject
- Remi::DataSource
- Includes:
- Testing::DataStub
- Defined in:
- lib/remi/cucumber.rb,
lib/remi/data_subject.rb
Direct Known Subclasses
Defined Under Namespace
Classes: CsvFile, DataFrame, Postgres, Salesforce
Instance Attribute Summary
Attributes inherited from DataSubject
Instance Method Summary collapse
-
#df ⇒ Object
Public: Access the dataframe from a DataSource.
-
#extract ⇒ Object
Public: Memoized version of extract!.
-
#extract! ⇒ Object
Public: Called to extract data from the source.
-
#to_dataframe ⇒ Object
Public: Converts extracted data to a dataframe.
Methods included from Testing::DataStub
#empty_stub_df, #stub_boolean, #stub_date, #stub_datetime, #stub_decimal, #stub_df, #stub_float, #stub_integer, #stub_json, #stub_row_array, #stub_string, #stub_values
Methods inherited from DataSubject
#df=, #enforce_types, #field_symbolizer, #initialize
Constructor Details
This class inherits a constructor from Remi::DataSubject
Instance Method Details
#df ⇒ Object
Public: Access the dataframe from a DataSource
Returns a Remi::DataFrame
60 61 62 |
# File 'lib/remi/data_subject.rb', line 60 def df @dataframe ||= to_dataframe end |
#extract ⇒ Object
Public: Memoized version of extract!
65 66 67 |
# File 'lib/remi/data_subject.rb', line 65 def extract @extract ||= extract! end |
#extract! ⇒ Object
Public: Called to extract data from the source.
Returns data in a format that can be used to create a dataframe.
72 73 74 75 |
# File 'lib/remi/data_subject.rb', line 72 def extract! raise NoMethodError, "#{__method__} not defined for #{self.class.name}" @extract end |
#to_dataframe ⇒ Object
Public: Converts extracted data to a dataframe
Returns a Remi::DataFrame
80 81 82 |
# File 'lib/remi/data_subject.rb', line 80 def to_dataframe raise NoMethodError, "#{__method__} not defined for #{self.class.name}" end |