lib/cantango/permit_store/permit/creator.rb
def create_permit_class
        Object.const_set class_name, Class.new do 
          def add_rules mode, rules
            mode_rules[name] = rules
          end
                
          def mode_rules
            @mode_rules ||= {}
          end
        end      
      end
# rules is a Hashie, a Hash where keys can also be accessed as method calls
rules is a Hashie, a Hash where keys can also be accessed as method calls
rules is a Hashie a Hash where keys can also be accessed as method calls
def create_permit_class
        Object.const_set class_name, Class.new do 
          def add_rules mode, rules
            mode_rules[name] = rules
          end
          def mode_rules
            @mode_rules ||= {}
          end
        end      
      end
def create_permit_class Object . const_set class_name , Class . new do def add_rules mode , rules mode_rules [ name ] = rules end def mode_rules @mode_rules ||= { } end end end
rules is a Hashie, a Hash where keys can also be accessed as method calls
rules is a Hashie a Hash where keys can also be accessed as method calls