Class: Remi::DataSubject

Inherits:
Object
  • Object
show all
Defined in:
lib/remi/data_subject.rb

Defined Under Namespace

Modules: CsvFile, DataSource, DataTarget, Postgres, Salesforce

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, fields: Remi::Fields.new, remi_df_type: :daru, logger: Remi::Settings.logger, **kargs, &block) ⇒ DataSubject

Returns a new instance of DataSubject.



8
9
10
11
12
# File 'lib/remi/data_subject.rb', line 8

def initialize(*args, fields: Remi::Fields.new, remi_df_type: :daru, logger: Remi::Settings.logger, **kargs, &block)
  @fields = fields
  @remi_df_type = remi_df_type
  @logger = logger
end

Instance Attribute Details

#fieldsObject

Returns the value of attribute fields.



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

def fields
  @fields
end

Instance Method Details

#dfObject



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

def df
  @dataframe ||= Remi::DataFrame.create(@remi_df_type, [], order: @fields.keys)
end

#df=(new_dataframe) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/remi/data_subject.rb', line 24

def df=(new_dataframe)
  if new_dataframe.respond_to? :remi_df_type
    @dataframe = new_dataframe
  else
    @dataframe = Remi::DataFrame.create(@remi_df_type, new_dataframe)
  end
end

#field_symbolizerObject



16
17
18
# File 'lib/remi/data_subject.rb', line 16

def field_symbolizer
  Remi::FieldSymbolizers[:standard]
end