module MySQLExpectations
Copyright © 2015 Yahoo Inc. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
Copyright © 2015 Yahoo Inc. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
Copyright © 2015 Yahoo Inc. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
rubocop:disable Style/PredicateName
Copyright © 2015 Yahoo Inc. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
Copyright © 2015 Yahoo Inc. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
Copyright © 2015 Yahoo Inc. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
Copyright © 2015 Yahoo Inc. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
Copyright © 2015 Yahoo Inc. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
Copyright © 2015 Yahoo Inc. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
Public Instance Methods
# File lib/mysql_expectations/database.rb, line 43 def method_missing(method, *arguments, &block) if arguments.empty? && block.nil? table_name = method.to_s return table(table_name) if table?(table_name) end super end
# File lib/mysql_expectations/database.rb, line 17 def name @database_element.attributes['name'] end
# File lib/mysql_expectations/database.rb, line 51 def respond_to_missing?(method, *) table?(method.to_s) || super end
# File lib/mysql_expectations/database.rb, line 28 def table(name) query = "table_structure[@name='#{name}']" table_element = @database_element.elements[query] Table.new table_element if table_element end
# File lib/mysql_expectations/database.rb, line 21 def table?(name) query = "table_structure[@name='#{name}']" !@database_element.elements[query].nil? end
# File lib/mysql_expectations/database.rb, line 34 def tables query = 'table_structure' tables = [] @database_element.elements.each(query) do |table_element| tables << Table.new(table_element) end tables end