Class: XRay::HTML::TextElement
Constant Summary
Constants inherited
from Element
Element::CLASS, Element::ID, Element::PROP, Element::PROP_PAIR, Element::WORD
Instance Attribute Summary
Attributes inherited from Element
#children, #close_type, #ending, #parent, #props, #scopes, #tag
Instance Method Summary
collapse
Methods inherited from Element
#each, #empty?, #has_prop?, #has_scope?, #in_scope?, #match?, #prop, #prop_text, #prop_value, #query, #self_closed?
Constructor Details
#initialize(text = "") ⇒ TextElement
Returns a new instance of TextElement.
176
177
178
179
|
# File 'lib/html/struct.rb', line 176
def initialize(text="")
super(nil)
@text = text.to_s
end
|
Instance Method Details
#==(other) ⇒ Object
188
189
190
|
# File 'lib/html/struct.rb', line 188
def ==(other)
text == other.text
end
|
#auto_close? ⇒ Boolean
194
|
# File 'lib/html/struct.rb', line 194
def auto_close? ; false; end
|
#closed? ⇒ Boolean
195
|
# File 'lib/html/struct.rb', line 195
def closed? ; true; end
|
#inline? ⇒ Boolean
193
|
# File 'lib/html/struct.rb', line 193
def inline?; true; end
|
#tag_name ⇒ Object
182
|
# File 'lib/html/struct.rb', line 182
def tag_name; nil; end
|
#tag_name_equal?(name) ⇒ Boolean
192
|
# File 'lib/html/struct.rb', line 192
def tag_name_equal?(name); false; end
|
#text ⇒ Object
Also known as:
inner_text, inner_html, outer_html
181
|
# File 'lib/html/struct.rb', line 181
def text; @text; end
|
#to_s ⇒ Object
197
198
199
|
# File 'lib/html/struct.rb', line 197
def to_s
"[TEXT: #{text}]"
end
|