class SchemaReader::Table

Attributes

attributes[R]
name[R]

Public Class Methods

new(name, attributes) click to toggle source
# File lib/schema_reader.rb, line 91
def initialize(name, attributes)
  @name, @attributes = name, attributes
end
parse(table_data) click to toggle source
# File lib/schema_reader.rb, line 95
def self.parse(table_data)
  return unless name = table_data[/table "(.+)"/]
  name = $1
  atts = table_data.lines.to_a.select {|line| line =~ /t\.\w+/ }.map {|att| Attribute.parse att }
  Table.new(name, atts)
end