Method: WIKK::SQL#each_sym
- Defined in:
-
lib/wikk_mysql2.rb,
lib/wikk_ruby_mysql.rb
@result and @affected_rows are also set via call to query().
Yields query result row by row, as Hash using Symbol keys, so can’t have table names included. This can be used with keyword arguments. eg. each_sym { |key1:, key2:, …, **rest_of_args| do something }
234 235 236 237 238 239 240 241 242 243 |
# File 'lib/wikk_mysql2.rb', line 234 def each_sym(the_query, &block) query(the_query, { symbolize_keys: true, as: :hash, cache_rows: false }) if @result != nil if block_given? @result.each(&block) else return @result.to_a end end end |