Class: LanguageParser::SQLTable
- Inherits:
-
Object
- Object
- LanguageParser::SQLTable
- Defined in:
- lib/cgialib/lp/SQLLanguageScanner.rb
Overview
class : SQLTable
Represents an SQL table definition
Instance Attribute Summary collapse
-
#comment ⇒ Object
The comment associated with the table.
-
#fields ⇒ Object
readonly
The fields of the table.
-
#name ⇒ Object
The name of the table.
Instance Method Summary collapse
-
#add_field(field) ⇒ Object
add_field( field ).
-
#get_field(name) ⇒ Object
get_field( name ).
-
#initialize ⇒ SQLTable
constructor
initialize().
Constructor Details
#initialize ⇒ SQLTable
initialize()
Constructor
65 66 67 68 69 70 71 72 |
# File 'lib/cgialib/lp/SQLLanguageScanner.rb', line 65 def initialize() @name = "" @fields = [] @field_hash = {} @comment = "" end |
Instance Attribute Details
#comment ⇒ Object
The comment associated with the table
76 77 78 |
# File 'lib/cgialib/lp/SQLLanguageScanner.rb', line 76 def comment @comment end |
#fields ⇒ Object (readonly)
The fields of the table
75 76 77 |
# File 'lib/cgialib/lp/SQLLanguageScanner.rb', line 75 def fields @fields end |
#name ⇒ Object
The name of the table
74 75 76 |
# File 'lib/cgialib/lp/SQLLanguageScanner.rb', line 74 def name @name end |
Instance Method Details
#add_field(field) ⇒ Object
add_field( field )
field - The field object
Adds a field to the table
84 85 86 87 88 89 |
# File 'lib/cgialib/lp/SQLLanguageScanner.rb', line 84 def add_field( field ) @fields.push( field ) @field_hash[ field.name.to_s.downcase ] = field end |
#get_field(name) ⇒ Object
get_field( name )
name - The name of the field
Fetchs a field object based on it’s name
97 98 99 |
# File 'lib/cgialib/lp/SQLLanguageScanner.rb', line 97 def get_field( name ) @field_hash[ name.downcase ] end |