Class: Mode::Sdk::Column

Inherits:
Object
  • Object
show all
Extended by:
WarehouseUtil
Includes:
HashUtil
Defined in:
lib/mode/sdk/column.rb

Overview

Represents a single column of a table stored in the Mode public data warehouse

Defined Under Namespace

Classes: InvalidError

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WarehouseUtil

normalize_name

Methods included from HashUtil

#stringify_keys

Constructor Details

#initialize(attributes) ⇒ Mode::Sdk::Column

Construct a new Column instance

Parameters:

  • attributes (Hash)

    hash of column attributes


25
26
27
# File 'lib/mode/sdk/column.rb', line 25

def initialize(attributes)
  @attributes = stringify_keys(attributes)
end

Instance Attribute Details

#attributesHash

hash of column attributes

Returns:

  • (Hash)

    the current value of attributes


13
14
15
# File 'lib/mode/sdk/column.rb', line 13

def attributes
  @attributes
end

Instance Method Details

#validate!true

Validate the provided column attributes

Returns:

  • (true)

33
34
35
36
37
38
39
# File 'lib/mode/sdk/column.rb', line 33

def validate!
  validate_keys!
  validate_name!
  validate_type!

  true
end