search for: instance_vari

Displaying 20 results from an estimated 24 matches for "instance_vari".

Did you mean: instance_var
2006 Apr 07
3
Pointer position on keypress event?
Hi. Is there any straightforward way to tell pointer position (x, y) upon keypress? In original wxWidgets, wxKeyEvent supports GetX() and GetY() methods, but wxRuby''s KeyEvent object does not have one. I also checked with event.methods and event.instance_variables. Do I need to keep track of pointer position by evt_motion? -- Taisuke Yamada <tyamadajp@spam.rakugaki.org>, http://rakugaki.org/ 2268 E9A2 D4F9 014E F11D 1DF7 DCA3 83BC 78E5 CD3A Message to my public address may not be handled in a timely manner. For a direct contact, please use my...
2007 Aug 07
2
stubs which yield and return
...@klass.new end def evaluate(&blk) @klass.instance_eval(&blk) end attr_reader :klass alias_method :class, :klass end One of the behaviours of the AnonymousClass is that new can take a block, and eval the block in the anonymous class, represented by the @klass instance_variable: ac = AnonymousClass.new do include Enumerable end So is there a way to stub AnonymousClass.new such that it yield an AnonymousClass mock, as well as yielding to the block given? What are the technical challenges involved in implementing this in the mocking framework? Or is it a ma...
2006 Feb 01
4
Viewing all Properties and Methods?
Hello, How can I see all the properties (member variables) and methods (functions) that are available for an object? Is there a function similar to PHP''s var_dump in MySQL? Many thanks for your assistance. Frank --------------------------------- What are the most popular cars? Find out at Yahoo! Autos -------------- next part -------------- An HTML attachment
2006 Jan 20
47
SQL Server datetime error
i have a problem with the datetime format of rails. i am unable to save a dataset to the db. here''s the error message -- the original error message was in german, so i translated it -- i get: DBI::DatabaseError: Execute OLE error code:80040E07 in Microsoft OLE DB Provider for SQL Server Couldn''t convert a char-Datatype to datetime HRESULT error code:0x80020009
2006 Mar 12
2
Find all the methods on a object in an irb session?
How can I find all the methods on an object from withing irb? Thanks, Joe
2006 Feb 25
2
How do templates get access to controller variables?
This is probably more of a Ruby question than a Rails question. I''ve always wondered exactly how controller instance variables are being made accessible to the ERb code in the views. In the Agile Rails book on pages 38, there''s a sidebar at the top that hints at what''s going on: "Rails does some Ruby magic so that the instance variables of the controller
2006 Jul 06
1
How did I turn off params ?
I am trying to create an input form where subsets of the input data goes into separate rows of the table (events). I have created a proxy object (CompoundEvent) to hold all of the data, and overridden its "save" method to create the several tuples. This was almost working late last night when I did something that stopped the params[] hash from getting any information from the post
2007 Aug 30
3
Rails - depot application
I''m doing the depot example in the Agle Web development book. I''m getting this error: "undefined method `product'' for #<BigDecimal:331ce70,''0.21E1'',8(8)> " "Extracted source (around line #9): 8: for item in @items 9: product = item.product 10: -%> 11: <tr> 12: <td><%= item.product%></td>"
2006 Jun 14
5
Rails SOAP tutorial
Hi all.. I new in Ruby/Rails.. Where could i get some good tutorial about SOAP using Rails? I''ve been googling yet still did''nt find good tutorial. Thank you in advance.. :) -- Regards, Ananda Putra
2009 Apr 01
3
Nil being coerced to float
I was doing this: @line_items = LineItems.find_all_by_invoice_id(params[:id]) @payments = Payments.find_all_by_invoice_id(params[:id]) @total = @line_items.sum{ |item| item.cost } @payment_total = @payments.sum{ |payment| payment.value } @balance = @total - @payment_total But when no payments had been made it was coming up with an error when trying to sum nil, so I did
2006 Oct 05
3
Exception Notifier plugin has stopped working.
...for 0), but there is no method on that line with only 1 argument. Any help is appreciated. --- ActionView::TemplateError (wrong number of arguments (1 for 0)) on line #3 of vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml: 1: <% for variable in @request.session.instance_variables -%> 2: <% next if variable =~ /^@db/ -%> 3: * <%= variable %>: <%= PP.pp(@request.session.instance_variable_get(variable),"").gsub(/\n/, "\n ").strip %> 4: <% end -%> /usr/local/lib/ruby/1.8/pp.rb:244:in `method'' /usr/local/li...
2006 Jun 26
0
DBI question. How do I load a database with data parsed from REXML?
...SQL server dbh = DBI.connect("dbi:Mysql:newsfeeds:localhost","eleven","foo") row = dbh.select_one("SELECT VERSION()") puts "Connecting to Server Version: " + row[0] #connection check # Start the SQL madness here: docparser.call.instance_variables {|x| x.each {|z| assort(z)}} rescue DBI::DatabaseError => e puts "An error occured" puts "Error code: #{e.err}" puts "Error messages: #{e.errstr}" ensure # Disconnect from server dbh.disconnect if dbh end def assort(ArticleLoad)...
2006 Jan 29
6
tyro Ruby questin
..."=>"P", "group_id"=>nil, "id"=>"1", "loggedIn"=>"0", "baseRole"=>"S", "monDtlDef_id"=>nil}> . When I change <td><%= i.inspect %></td> to <td><%= i.instance_variables %></td> my output is @attributes @attributes @attributes Further inspection shows @attributes is an array of length 1. My question is, given that the inspect method shows what I need, how do I reference the list of columns? (Once there, I can reference i.currentRol...
2006 Jul 05
2
Serialized object behaves weird
Hi! I got a class named EinsatzFilter which I serialized to session. Before saving to session it works afterwards I keep getting the message: "undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from ActiveRecord::Base inherited class. Code: class EinsatzFilter include ApplicationHelper attr_reader :personen, :monat, :projekte, :kunde
2006 Mar 10
0
WEBrick crashing
...0.00 6.55 0.00 1 0.00 2688.00 Reloadable.reloadable_clas ses 0.00 6.55 0.00 1 0.00 0.00 WEBrick::HTTPRequest#fixup 0.00 6.55 0.00 18 0.00 0.00 Array#<< 0.00 6.55 0.00 1 0.00 0.00 Kernel.instance_variables 0.00 6.55 0.00 1 0.00 0.00 Dependencies.mechanism 0.00 6.55 0.00 1 0.00 0.00 Dependencies.load? 0.00 6.55 0.00 12 0.00 0.00 Hash#[] 0.00 6.55 0.00 2 0.00 0.00 Hash#[]= 0.00 6.5...
2006 Jun 30
6
RSS::Parser Documentation
Hi I am trying to use the RSS classes from "rss/2.0" and everything works but I want to know what attributes and properties I can get at from each of the classes I am getting back. For example, the class has a "channel" which I can tell has a "title" attribute (because it works when I query it :) but I would really like a list of every attribute that is
2006 Mar 26
4
edge and 1.8.2/1.8.4 issues
I recently upgraded to 1.8.4 to try out mongrel, and so far have been in a kind of hell where I can''t get my app working! Currently running (or trying to run): Ruby version 1.8.4 (i386-mswin32) RubyGems version 0.8.11 Rails version 1.0.0 Active Record version 1.13.2 Action Pack version 1.11.2 Action Web Service version 1.0.0 Action Mailer version 1.1.5 Active Support version
2005 Dec 27
3
myObject.send(column.name) from Agile Development book
I''m studying the Agile Development with Rails book. In the chapter that first sets up the depot application (page 68), there is this bit of code from a view: <% for product in @products %> <tr> <% for column in Product.content_columns %> <td><%=h product.send(column.name) %></td> <% end %> etc... I am trying to absorb both Ruby and
2005 Mar 09
21
Converting time retrieved from MySQL
I''m having a problem converting a date retrieved from my MySQL database and I''m hoping someone can help. MySQL stores the date/time as this: 2005-03-08 17:00:34.0 and according to my Pickaxe book Ruby stores times as "the number of seconds and microseconds since [...] January 1, 1970". All well and good. Unfortunately, RoR is converting my date to this:
2006 May 08
17
partial problem
def my_controller @variable = [{''myfield''=>''grey''},{''myfield''=>''blue''}] end #-------------------------my_view <table> <%= render :partial=>''my_partial, :collection=>@variable %> </table> #----------------------_my_partial <tr> <td><%=