Class: Regex::MatchOption
- Inherits:
-
Object
- Object
- Regex::MatchOption
- Defined in:
- lib/regex/match_option.rb
Overview
Represents an option that influences the way a regular (sub)expression can perform its matching.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The symbolic name of the option.
-
#setting ⇒ Object
readonly
An indicator that tells whether the option is turned on or off.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Equality operator.
-
#initialize(theName, theSetting) ⇒ MatchOption
constructor
Constructor.
Constructor Details
#initialize(theName, theSetting) ⇒ MatchOption
Constructor.
14 15 16 17 |
# File 'lib/regex/match_option.rb', line 14 def initialize(theName, theSetting) @name = theName @setting = theSetting end |
Instance Attribute Details
#name ⇒ Object (readonly)
The symbolic name of the option
8 9 10 |
# File 'lib/regex/match_option.rb', line 8 def name @name end |
#setting ⇒ Object (readonly)
An indicator that tells whether the option is turned on or off
11 12 13 |
# File 'lib/regex/match_option.rb', line 11 def setting @setting end |
Instance Method Details
#==(other) ⇒ Object
Equality operator
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/regex/match_option.rb', line 20 def ==(other) return true if object_id == other.object_id if other.kind_of?(MatchOption) isEqual = ((name == other.name) && (setting == other.setting)) else isEqual = false end return isEqual end |