Class: TheDude::Variable
- Inherits:
-
Object
- Object
- TheDude::Variable
- Defined in:
- lib/the_dude/variable.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
- Symbol
-
The name of the variable.
-
#pattern ⇒ Object
readonly
- Regexp
-
The pattern associated with the variable.
Instance Method Summary collapse
-
#initialize(name, pattern) ⇒ TheDude::Variable
constructor
Creates an new variable instance based on the provided name and pattern.
- #register ⇒ Object
Constructor Details
#initialize(name, pattern) ⇒ TheDude::Variable
Creates an new variable instance based on the provided name and pattern.
16 17 18 19 |
# File 'lib/the_dude/variable.rb', line 16 def initialize name, pattern @name = name @pattern = pattern end |
Instance Attribute Details
#name ⇒ Object (readonly)
- Symbol
-
The name of the variable
5 6 7 |
# File 'lib/the_dude/variable.rb', line 5 def name @name end |
#pattern ⇒ Object (readonly)
- Regexp
-
The pattern associated with the variable
8 9 10 |
# File 'lib/the_dude/variable.rb', line 8 def pattern @pattern end |
Instance Method Details
#register ⇒ Object
21 22 23 |
# File 'lib/the_dude/variable.rb', line 21 def register TheDude.register_variable self end |