Class: ActiveMocker::SchemaReader
- Inherits:
-
Object
- Object
- ActiveMocker::SchemaReader
- Defined in:
- lib/active_mocker/schema_reader.rb
Instance Attribute Summary collapse
-
#clear_cache ⇒ Object
readonly
Returns the value of attribute clear_cache.
-
#file_reader ⇒ Object
readonly
Returns the value of attribute file_reader.
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
-
#schema_file ⇒ Object
readonly
Returns the value of attribute schema_file.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ SchemaReader
constructor
A new instance of SchemaReader.
- #search(model_name) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ SchemaReader
7 8 9 10 11 |
# File 'lib/active_mocker/schema_reader.rb', line 7 def initialize(={}) @file_reader = [:file_reader] ||= FileReader @schema_file = [:schema_file] @clear_cache = [:clear_cache] end |
Instance Attribute Details
#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 |
#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 |
#table ⇒ Object (readonly)
Returns the value of attribute table.
5 6 7 |
# File 'lib/active_mocker/schema_reader.rb', line 5 def table @table end |
Instance Method Details
#search(model_name) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/active_mocker/schema_reader.rb', line 13 def search(model_name) @model_name = model_name @table = search_schema_file @table @table end |