Class: Browser::DOM::CharacterData
- Defined in:
- opal/browser/dom/character_data.rb
Constant Summary
Constants inherited from Node
Node::ATTRIBUTE_NODE, Node::CDATA_SECTION_NODE, Node::COMMENT_NODE, Node::DOCUMENT_FRAGMENT_NODE, Node::DOCUMENT_NODE, Node::DOCUMENT_TYPE_NODE, Node::ELEMENT_NODE, Node::ENTITY_NODE, Node::ENTITY_REFERENCE_NOCE, Node::NOTATION_NODE, Node::PROCESSING_INSTRUCTION_NODE, Node::TEXT_NODE
Instance Attribute Summary collapse
-
#data ⇒ String
readonly
The data of the node.
-
#length ⇒ Integer
readonly
The length of the node.
Attributes inherited from Node
#child, #children, #document, #element_children, #first_element_child, #last_element_child, #name, #namespace, #next, #next_element, #node_type, #outer_html, #parent, #previous, #previous_element, #value
Instance Method Summary collapse
-
#append(string) ⇒ self
Append data to the node.
-
#delete(count, offset = 0) ⇒ self
Delete data from the node.
-
#insert(string, offset = 0) ⇒ self
Insert data in the node.
-
#replace(string, offset = 0, count = `#@native.length`) ⇒ self
Replace data in the node.
-
#substring(count, offset = 0) ⇒ String
Get a substring of the data.
Methods inherited from Node
#<<, #==, #>>, #add_child, #add_next_sibling, #add_previous_sibling, #ancestors, #append_to, #attached?, #blank?, #cdata?, #clear, #comment?, #content, #content=, #custom?, #document?, #elem?, #fragment?, #initialize, #initialize_copy, new, #parse, #path, #prepend_to, #remove, #remove_child, #text?, #traverse
Methods included from NativeCachedWrapper
#restricted?, #set_native_reference
Constructor Details
This class inherits a constructor from Browser::DOM::Node
Instance Attribute Details
permalink #data ⇒ String (readonly)
Returns the data of the node.
18 19 20 |
# File 'opal/browser/dom/character_data.rb', line 18 def data `#@native.data` end |
permalink #length ⇒ Integer (readonly)
Returns the length of the node.
48 |
# File 'opal/browser/dom/character_data.rb', line 48 alias_native :length |
Instance Method Details
permalink #append(string) ⇒ self
Append data to the node.
10 11 12 13 14 |
# File 'opal/browser/dom/character_data.rb', line 10 def append(string) `#@native.appendData(string)` self end |
permalink #delete(count, offset = 0) ⇒ self
Delete data from the node.
28 29 30 31 32 |
# File 'opal/browser/dom/character_data.rb', line 28 def delete(count, offset = 0) `#@native.deleteData(offset, count)` self end |
permalink #insert(string, offset = 0) ⇒ self
Insert data in the node.
40 41 42 43 44 |
# File 'opal/browser/dom/character_data.rb', line 40 def insert(string, offset = 0) `#@native.insertData(offset, string)` self end |
permalink #replace(string, offset = 0, count = `#@native.length`) ⇒ self
Replace data in the node.
57 58 59 60 61 |
# File 'opal/browser/dom/character_data.rb', line 57 def replace(string, offset = 0, count = `#@native.length`) `#@native.replaceData(offset, count, string)` self end |
permalink #substring(count, offset = 0) ⇒ String
Get a substring of the data.
69 70 71 |
# File 'opal/browser/dom/character_data.rb', line 69 def substring(count, offset = 0) `#@native.substringData(offset, count)` end |