Sha256: 4fd09d10df1e8363504264fc43aa1c21227811380cf32551aadc2394badfbde6

Contents?: true

Size: 435 Bytes

Versions: 14

Compression:

Stored size: 435 Bytes

Contents

require 'pathname'
module ActiveMocker
  # @api private
  class SchemaReader

    def tables
      load_table
    end

    private

    def load_table
      eval_file
      raise "#{table_name} table not found." unless @tables
      @tables
    end

    def eval_file
      m = Module.new
      @tables = m.module_eval(read_file).tables
    end

    def read_file
      Config.file_reader.read(Config.schema_file)
    end

  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
active_mocker-1.8.4 lib/active_mocker/schema_reader.rb
active_mocker-1.8.3 lib/active_mocker/schema_reader.rb
active_mocker-1.8.2 lib/active_mocker/schema_reader.rb
active_mocker-1.8.1 lib/active_mocker/schema_reader.rb
active_mocker-1.8 lib/active_mocker/schema_reader.rb
active_mocker-1.7.3 lib/active_mocker/schema_reader.rb
active_mocker-1.7.2 lib/active_mocker/schema_reader.rb
active_mocker-1.7.1 lib/active_mocker/schema_reader.rb
active_mocker-1.7.1rc lib/active_mocker/schema_reader.rb
active_mocker-1.7 lib/active_mocker/schema_reader.rb
active_mocker-1.7rc2 lib/active_mocker/schema_reader.rb
active_mocker-1.7.beta3 lib/active_mocker/schema_reader.rb
active_mocker-1.7.beta2 lib/active_mocker/schema_reader.rb
active_mocker-1.7.beta1 lib/active_mocker/schema_reader.rb