Bugs: Browse | Submit New | Admin

[#11965] method_missing "lower_case_underscore" parameter objects are nil

Date:
2007-07-02 22:47
Priority:
3
Submitted By:
Nobody
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
method_missing "lower_case_underscore" parameter objects are nil

Detailed description
I've tried the example code as presented in the documentation (with an unused object name defaulting to the parameter
object) like so:

%%% test.rb
require 'rubygems'
require 'rools'

rules=Rools::RuleSet.new do
  rule "yello" do
    parameter String
    consequence {
      puts parameter_object_shouldnt_be_nil
    }
  end
end

rules.assert "I'm not nil!"
%%%

And when I run this script in ruby, I get the following output:

% ruby test.rb
nil
% ...

This doesn't work as documented, and it's kind of upsetting if I can only fire rules knowing what kind of class it is.
The same problem appears in the condition {} blocks.  Did method_missing change behaviours between versions or
something?

It's probably a simple fix.  Is there a newer version than the gem (which is rools-0.2)?  Where can I find it?

I like how you set up the domain-specific language here, and I don't like reinventing the wheel.  ruby-rules, the other
rules engine, won't even run as a rubygem, so this is still a step up.

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item