Class: Richard::Internal::TextLine

Inherits:
Object
  • Object
show all
Defined in:
lib/richard_iii/internal/text_line.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ TextLine

Returns a new instance of TextLine.



6
7
8
# File 'lib/richard_iii/internal/text_line.rb', line 6

def initialize(text)
  @text = text || fail("You need to supply some text even if it's empty")
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



4
5
6
# File 'lib/richard_iii/internal/text_line.rb', line 4

def text
  @text
end

Instance Method Details

#matches?(text) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/richard_iii/internal/text_line.rb', line 10

def matches?(text)
  @text.eql?(text)
end