Class: Lutaml::Qea::Services::Configuration::TableDefinition

Inherits:
Model::Serializable
  • Object
show all
Defined in:
lib/lutaml/qea/services/configuration.rb

Overview

Table definition model

Instance Method Summary collapse

Instance Method Details

#boolean_column?(column_name) ⇒ Boolean

Check if a column is boolean type

Parameters:

  • column_name (String)

    The column name

Returns:

  • (Boolean)

    true if column should be treated as boolean



71
72
73
74
# File 'lib/lutaml/qea/services/configuration.rb', line 71

def boolean_column?(column_name)
  col = column_for(column_name)
  col&.boolean == true
end

#column_for(column_name) ⇒ ColumnDefinition?

Get column definition by name

Parameters:

  • column_name (String)

    The column name

Returns:



63
64
65
# File 'lib/lutaml/qea/services/configuration.rb', line 63

def column_for(column_name)
  columns&.find { |col| col.name == column_name }
end