Class: ElementFactory::Elements::TextElement

Inherits:
Object
  • Object
show all
Defined in:
lib/element_factory/elements/text_element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ TextElement

Returns a new instance of TextElement.



6
7
8
# File 'lib/element_factory/elements/text_element.rb', line 6

def initialize(string)
  @string = string
end

Instance Attribute Details

#stringObject

Returns the value of attribute string.



4
5
6
# File 'lib/element_factory/elements/text_element.rb', line 4

def string
  @string
end

Instance Method Details

#to_htmlObject



10
11
12
# File 'lib/element_factory/elements/text_element.rb', line 10

def to_html
  ERB::Util.h(string)
end