Advertisement
Guest User

Untitled

a guest
Sep 15th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.77 KB | None | 0 0
  1. class Table
  2.  
  3.         def initialize(res, meth, db)
  4.                 puts %[Struct.new(#{meth}, #{(db.table_info(meth).collect {|x| x["name"] }).join(",")})]
  5.         end
  6. end
  7.  
  8. ##############################################################################################
  9.  
  10.  
  11. [11] pry(main)> Table.new(db.execute "SELECT * FROM Actions", "Actions", db)
  12. #SQLite3::RangeException: bind or column index out of range
  13. #from /usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.6/lib/sqlite3/statement.rb:41:in #`bind_param'
  14.  
  15. ##############################################################################################
  16.  
  17. [12] pry(main)> puts %[Struct.new(#{meth}, #{(db.table_info(meth).collect {|x| x["name"] }).join(",")})]
  18. Struct.new(Actions, Action,Reaction,Return)
  19. => nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement