Class: TreasureData::Schema::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/td/client/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, sql_alias = nil) ⇒ Field

Returns a new instance of Field.

Parameters:

  • name (String)
  • type (String)
  • sql_alias (String) (defaults to: nil)


286
287
288
289
290
291
292
293
294
295
# File 'lib/td/client/model.rb', line 286

def initialize(name, type, sql_alias=nil)
  if name == 'v' || name == 'time'
    raise ParameterValidationError, "Column name '#{name}' is reserved."
  end
  API.validate_column_name(name)
  API.validate_sql_alias_name(sql_alias) if sql_alias
  @name = name
  @type = type
  @sql_alias = sql_alias
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



299
300
301
# File 'lib/td/client/model.rb', line 299

def name
  @name
end

#sql_aliasObject (readonly)

Returns the value of attribute sql_alias.



301
302
303
# File 'lib/td/client/model.rb', line 301

def sql_alias
  @sql_alias
end

#typeObject (readonly)

Returns the value of attribute type.



299
# File 'lib/td/client/model.rb', line 299

attr_reader :name