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



7
8
9
10
11
# File 'lib/active_mocker/schema_reader.rb', line 7

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

Instance Attribute Details

#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

#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

#tableObject (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