Created
September 29, 2010 16:34
-
-
Save thommay/603074 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| irb >> m = Multicast.create({:addr => "1.2.3.4", :port => 1}) | |
| /usr/lib/ruby/gems/1.8/gems/simply_stored-0.3.8/lib/simply_stored.rb:7: warning: already initialized constant VERSION | |
| NoMethodError: undefined method `to_i' for true:TrueClass | |
| from /usr/lib/ruby/1.8/ipaddr.rb:449:in `initialize' | |
| from /usr/lib/ruby/1.8/ipaddr.rb:499:in `new' | |
| from /usr/lib/ruby/1.8/ipaddr.rb:499:in `coerce_other' | |
| from /usr/lib/ruby/1.8/ipaddr.rb:140:in `==' | |
| from /usr/lib/ruby/gems/1.8/gems/validatable-1.6.7/lib/validations/validates_true_for.rb:6:in `valid?' | |
| from /usr/lib/ruby/gems/1.8/gems/validatable-1.6.7/lib/validatable_instance_methods.rb:74:in `run_validation' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| so i hacked IPAddr#initialize to print the addr and the addr's class I was passing to IPAddr.new and got: | |
| 1.2.3.4 | |
| String | |
| true | |
| TrueClass | |
| wtf? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Multicast | |
| include SimplyStored::Couch | |
| property :addr | |
| property :port | |
| validates_true_for :addr, :logic => lambda { IPAddr.new addr } | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment