Class | Ohcount::Gestalt::Rule
In: | lib/gestalt/rules/rule.rb
Parent: | Object

### Methods

== method_missing to_sym to_sym

### Public Class methods

method_missing(m,*args)

[Source]

    # File lib/gestalt/rules/rule.rb, line 33
                            def self.method_missing(m,*args)
                                    if /(.*)_keywords$/ =~ m.to_s
                                            language = $1
                                            return rules << KeywordLibraryRule.new(language,args)
                                    end
                                    super
                            end

to_sym()

when tallying up libraries, its easier to use symbol names instead of class names to_sym maps FooLib to :foo_lib

[Source]

    # File lib/gestalt/rules/rule.rb, line 20
                            def self.to_sym
                                    @symbol ||= begin
                                                                                            to_s =~ /([^:]*)$/
                                                                                            naked_classname = $1
                                                                                            chars = naked_classname.scan(/./)
                                                                                            chars[0] = chars[0].downcase
                                                                                            ruby_s = chars.collect do |char|
                                                                                                    char.downcase == char ? char : "_" + char.downcase
                                                                                            end.to_s
                                                                                            ruby_s.intern
                                                                                    end
                            end

### Public Instance methods

==(other)

[Source]

    # File lib/gestalt/rules/rule.rb, line 4
                            def ==(other)
                                    return false unless self.class == other.class
                                    return false unless self.instance_variables == other.instance_variables
                                    self.instance_variables.each do |v|
                                            return false unless self.send(v[1..-1]) == other.send(v[1..-1])
                                    end
                                    true
                            end

to_sym()

[Source]

    # File lib/gestalt/rules/rule.rb, line 13
                            def to_sym
                                    self.class.to_sym
                            end

[Validate]