Class: Retab::WorkflowTableProfileColumn

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/tables/workflow_table_profile_column.rb

Constant Summary collapse

HASH_ATTRS =
{
  name: :name,
  json_schema: :json_schema,
  row_count: :row_count,
  null_count: :null_count,
  empty_count: :empty_count,
  distinct_count: :distinct_count,
  min: :min,
  max: :max,
  sample_values: :sample_values,
  is_estimated: :is_estimated
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WorkflowTableProfileColumn

Returns a new instance of WorkflowTableProfileColumn.



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 34

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @name = hash[:name]
  @json_schema = hash[:json_schema] || {}
  @row_count = hash[:row_count]
  @null_count = hash[:null_count]
  @empty_count = hash[:empty_count]
  @distinct_count = hash[:distinct_count]
  @min = hash[:min]
  @max = hash[:max]
  @sample_values = (hash[:sample_values] || [])
  @is_estimated = hash[:is_estimated].nil? ? false : hash[:is_estimated]
end

Instance Attribute Details

#distinct_countObject

Returns the value of attribute distinct_count.



21
22
23
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 21

def distinct_count
  @distinct_count
end

#empty_countObject

Returns the value of attribute empty_count.



21
22
23
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 21

def empty_count
  @empty_count
end

#is_estimatedObject

Returns the value of attribute is_estimated.



21
22
23
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 21

def is_estimated
  @is_estimated
end

#json_schemaObject

Returns the value of attribute json_schema.



21
22
23
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 21

def json_schema
  @json_schema
end

#maxObject

Returns the value of attribute max.



21
22
23
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 21

def max
  @max
end

#minObject

Returns the value of attribute min.



21
22
23
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 21

def min
  @min
end

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 21

def name
  @name
end

#null_countObject

Returns the value of attribute null_count.



21
22
23
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 21

def null_count
  @null_count
end

#row_countObject

Returns the value of attribute row_count.



21
22
23
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 21

def row_count
  @row_count
end

#sample_valuesObject

Returns the value of attribute sample_values.



21
22
23
# File 'lib/retab/tables/workflow_table_profile_column.rb', line 21

def sample_values
  @sample_values
end