Class: ActiveMocker::SchemaReader
- Inherits:
-
Object
- Object
- ActiveMocker::SchemaReader
- Defined in:
- lib/active_mocker/schema_reader.rb
Instance Attribute Summary collapse
-
#cache_file ⇒ Object
readonly
Returns the value of attribute cache_file.
-
#cache_tables ⇒ Object
readonly
Returns the value of attribute cache_tables.
-
#clear_cache ⇒ Object
readonly
Returns the value of attribute clear_cache.
-
#file_reader ⇒ Object
readonly
Returns the value of attribute file_reader.
-
#migration_dir ⇒ Object
readonly
Returns the value of attribute migration_dir.
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
-
#schema_file ⇒ Object
readonly
Returns the value of attribute schema_file.
-
#schema_version ⇒ Object
readonly
Returns the value of attribute schema_version.
-
#tables ⇒ Object
readonly
Returns the value of attribute tables.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ SchemaReader
constructor
A new instance of SchemaReader.
- #search(model_name) ⇒ Object
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(={}) @file_reader = [:file_reader] ||= FileReader @schema_file = [:schema_file] end |
Instance Attribute Details
#cache_file ⇒ Object (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_tables ⇒ Object (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_cache ⇒ Object (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_reader ⇒ Object (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_dir ⇒ Object (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_name ⇒ Object (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_file ⇒ Object (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_version ⇒ Object (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 |
#tables ⇒ Object (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 |