Parent

Regin::Character

Attributes

quantifier[R]

Public Class Methods

new(value, options = {}) click to toggle source
   # File lib/rack/mount/vendor/regin/regin/character.rb, line 5
5:     def initialize(value, options = {})
6:       @quantifier = options[:quantifier]
7:       super
8:     end

Public Instance Methods

include?(char) click to toggle source
    # File lib/rack/mount/vendor/regin/regin/character.rb, line 39
39:     def include?(char)
40:       if ignorecase
41:         value.downcase == char.downcase
42:       else
43:         value == char
44:       end
45:     end
literal?() click to toggle source

Returns true if expression could be treated as a literal string.

A Character is literal is there is no quantifier attached to it.

    # File lib/rack/mount/vendor/regin/regin/character.rb, line 17
17:     def literal?
18:       quantifier.nil? && !ignorecase
19:     end
match(char) click to toggle source
    # File lib/rack/mount/vendor/regin/regin/character.rb, line 35
35:     def match(char)
36:       to_regexp(true).match(char)
37:     end
option_names() click to toggle source
    # File lib/rack/mount/vendor/regin/regin/character.rb, line 10
10:     def option_names
11:       %( quantifier ) + super
12:     end
to_regexp(anchored = false) click to toggle source
    # File lib/rack/mount/vendor/regin/regin/character.rb, line 29
29:     def to_regexp(anchored = false)
30:       re = to_s(true)
31:       re = "\\A#{re}\\Z" if anchored
32:       Regexp.compile(re, ignorecase)
33:     end
to_s(parent = false) click to toggle source
    # File lib/rack/mount/vendor/regin/regin/character.rb, line 21
21:     def to_s(parent = false)
22:       if !parent && ignorecase
23:         "(?i-mx:#{value})#{quantifier}"
24:       else
25:         "#{value}#{quantifier}"
26:       end
27:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.