class Scheman::ParserBuilder

Public Class Methods

build(type) click to toggle source

@param type [String] A type of parser (e.g. “mysql”) @return [Scheman::Parsers::Base]

# File lib/scheman/parser_builder.rb, line 5
def self.build(type)
  new(type).build
end
new(type) click to toggle source

@param type [String]

# File lib/scheman/parser_builder.rb, line 10
def initialize(type)
  @type = type
end

Public Instance Methods

build() click to toggle source
# File lib/scheman/parser_builder.rb, line 14
def build
  parser_class.new
end

Private Instance Methods

parser_class() click to toggle source
# File lib/scheman/parser_builder.rb, line 20
def parser_class
  case @type
  when "mysql"
    Parsers::Mysql
  else
    raise Errors::ParserNotFound
  end
end