Class: ActiveMocker::SchemaReader

Inherits:
Object
  • Object
show all
Defined in:
lib/active_mocker/schema_reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ SchemaReader

Returns a new instance of SchemaReader.



15
16
17
18
19
# File 'lib/active_mocker/schema_reader.rb', line 15

def initialize(options={})
  @file_reader   = options[:file_reader] ||= FileReader
  @schema_file   = options[:schema_file]

end

Instance Attribute Details

#cache_fileObject (readonly)

Returns the value of attribute cache_file.



5
6
7
# File 'lib/active_mocker/schema_reader.rb', line 5

def cache_file
  @cache_file
end

#cache_tablesObject (readonly)

Returns the value of attribute cache_tables.



5
6
7
# File 'lib/active_mocker/schema_reader.rb', line 5

def cache_tables
  @cache_tables
end

#clear_cacheObject (readonly)

Returns the value of attribute clear_cache.



5
6
7
# File 'lib/active_mocker/schema_reader.rb', line 5

def clear_cache
  @clear_cache
end

#file_readerObject (readonly)

Returns the value of attribute file_reader.



5
6
7
# File 'lib/active_mocker/schema_reader.rb', line 5

def file_reader
  @file_reader
end

#migration_dirObject (readonly)

Returns the value of attribute migration_dir.



5
6
7
# File 'lib/active_mocker/schema_reader.rb', line 5

def migration_dir
  @migration_dir
end

#model_nameObject (readonly)

Returns the value of attribute model_name.



5
6
7
# File 'lib/active_mocker/schema_reader.rb', line 5

def model_name
  @model_name
end

#schema_fileObject (readonly)

Returns the value of attribute schema_file.



5
6
7
# File 'lib/active_mocker/schema_reader.rb', line 5

def schema_file
  @schema_file
end

#schema_versionObject (readonly)

Returns the value of attribute schema_version.



5
6
7
# File 'lib/active_mocker/schema_reader.rb', line 5

def schema_version
  @schema_version
end

#tablesObject (readonly)

Returns the value of attribute tables.



5
6
7
# File 'lib/active_mocker/schema_reader.rb', line 5

def tables
  @tables
end

Instance Method Details

#search(model_name) ⇒ Object



21
22
23
24
25
# File 'lib/active_mocker/schema_reader.rb', line 21

def search(model_name)
  @model_name = model_name
  load_table
  @tables
end