Class: Regenerate::TextVariable

Inherits:
PageComponent show all
Defined in:
lib/regenerate/web-page.rb

Overview

Base class for the text variable types

Direct Known Subclasses

CommentVariable, HtmlVariable

Instance Attribute Summary collapse

Attributes inherited from PageComponent

#parentPage, #text

Instance Method Summary collapse

Methods inherited from PageComponent

#addLine, #finishText, #finished, #initialize, #processEndComment, #processStartComment

Constructor Details

This class inherits a constructor from Regenerate::PageComponent

Instance Attribute Details

#varNameObject (readonly)

Returns the value of attribute varName.



111
112
113
# File 'lib/regenerate/web-page.rb', line 111

def varName
  @varName
end

Instance Method Details

#addToParentPageObject



117
118
119
120
# File 'lib/regenerate/web-page.rb', line 117

def addToParentPage
  #puts "TextVariable.addToParentPage #{@varName} = #{@text.inspect}"
  @parentPage.setPageObjectInstanceVar(@varName, @text)
end

#initializeFromStartComment(parsedCommentLine) ⇒ Object



113
114
115
# File 'lib/regenerate/web-page.rb', line 113

def initializeFromStartComment(parsedCommentLine)
  @varName = parsedCommentLine.instanceVarName
end

#textVariableValueObject



122
123
124
# File 'lib/regenerate/web-page.rb', line 122

def textVariableValue
  @parentPage.getPageObjectInstanceVar(@varName)
end