Class: Hexpress::Character
Instance Attribute Summary collapse
-
#upcase ⇒ Object
readonly
Returns the value of attribute upcase.
Instance Method Summary collapse
-
#initialize(name, upcase = false) ⇒ Character
constructor
A new instance of Character.
- #to_s ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(name, upcase = false) ⇒ Character
Returns a new instance of Character.
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/hexpress/character.rb', line 4 def initialize(name, upcase = false) @value = case name when :word then '\w' when :digit then '\d' when :space then '\s' when :any then '.' when :tab then '\t' when :newline then '\n' when :return then '\r' else name end @upcase = upcase end |
Instance Attribute Details
#upcase ⇒ Object (readonly)
Returns the value of attribute upcase.
3 4 5 |
# File 'lib/hexpress/character.rb', line 3 def upcase @upcase end |