ruby code generation question

Victor Hugo Borja vhbo... at
Thu Oct 4 15:36:07 UTC 2007


> Looking at the ruby code I see that orcscanner_start is defined like so:
> class << self
>          attr_accessor :orcscanner_start
> end
> self.orcscanner_start = 1;
> This is adding a class method #orcscanner_start to the current class
> (self). I guess it works fine when adding to Object (the default
> class) but not my custom class. Why? What am I doing wrong?

According to what I understand from your code, the ragel constants are
being added to
your SomeClass' metaclass. You may need to add something like:

class SomeClass
  def initialize
    %% write data;

  # your parse/utility methods here

More information about the ragel-users mailing list