Class: SybaseDefinitions::ColumnDefinition
- Inherits:
-
Object
- Object
- SybaseDefinitions::ColumnDefinition
- Defined in:
- lib/marjoree/sybase_definitions.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type) ⇒ ColumnDefinition
constructor
A new instance of ColumnDefinition.
- #is_not_nullable ⇒ Object
- #is_nullable ⇒ Object
- #to_hash ⇒ Object
- #with_identity ⇒ Object
- #with_size(size) ⇒ Object
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
#name ⇒ Object
Returns the value of attribute name.
186 187 188 |
# File 'lib/marjoree/sybase_definitions.rb', line 186 def name @name end |
#type ⇒ Object
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_nullable ⇒ Object
213 214 215 216 |
# File 'lib/marjoree/sybase_definitions.rb', line 213 def is_not_nullable @nullable = false return self end |
#is_nullable ⇒ Object
208 209 210 211 |
# File 'lib/marjoree/sybase_definitions.rb', line 208 def is_nullable @nullable = true return self end |
#to_hash ⇒ Object
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_identity ⇒ Object
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 |