Class: Ifilter::Input
- Inherits:
-
Object
- Object
- Ifilter::Input
- Defined in:
- lib/ifilter/input.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #<<(text) ⇒ Object
- #backspace! ⇒ Object
-
#initialize(text = '') ⇒ Input
constructor
A new instance of Input.
- #to_regex ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(text = '') ⇒ Input
Returns a new instance of Input.
5 6 7 |
# File 'lib/ifilter/input.rb', line 5 def initialize(text = '') @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/ifilter/input.rb', line 3 def text @text end |
Instance Method Details
#<<(text) ⇒ Object
9 10 11 |
# File 'lib/ifilter/input.rb', line 9 def <<(text) @text << text end |
#backspace! ⇒ Object
13 14 15 |
# File 'lib/ifilter/input.rb', line 13 def backspace! @text.chop! end |
#to_regex ⇒ Object
21 22 23 24 25 |
# File 'lib/ifilter/input.rb', line 21 def to_regex /#{@text}/i rescue nil end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/ifilter/input.rb', line 17 def to_s @text end |