Class: SybaseDefinitions::ColumnDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/marjoree/sybase_definitions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type) ⇒ ColumnDefinition

Returns a new instance of ColumnDefinition.



188
189
190
# File 'lib/marjoree/sybase_definitions.rb', line 188

def initialize( name, type )
    @name, @type = name, type
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



186
187
188
# File 'lib/marjoree/sybase_definitions.rb', line 186

def name
  @name
end

#typeObject

Returns the value of attribute type.



186
187
188
# File 'lib/marjoree/sybase_definitions.rb', line 186

def type
  @type
end

Instance Method Details

#is_not_nullableObject



213
214
215
216
# File 'lib/marjoree/sybase_definitions.rb', line 213

def is_not_nullable
    @nullable = false
    return self
end

#is_nullableObject



208
209
210
211
# File 'lib/marjoree/sybase_definitions.rb', line 208

def is_nullable
    @nullable = true
    return self
end

#to_hashObject



192
193
194
195
196
197
198
199
200
201
# File 'lib/marjoree/sybase_definitions.rb', line 192

def to_hash
    result = {}

    result[:name] = @name unless @name.nil?
    result[:type] = @type unless @type.nil?
    result[:nullable] = @nullable unless @nullable.nil?
    result[:column_size] = @size unless @size.nil?

    return result
end

#with_identityObject



218
219
220
221
# File 'lib/marjoree/sybase_definitions.rb', line 218

def with_identity
    @type += " identity";
    return self
end

#with_size(size) ⇒ Object



203
204
205
206
# File 'lib/marjoree/sybase_definitions.rb', line 203

def with_size( size )
    @size = size
    return self
end