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, #inner_html, #last_element_child, #name, #namespace, #next, #next_element, #node_type, #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, #blank?, #cdata?, #clear, #comment?, #content, #content=, #document?, #elem?, #fragment?, new, #parse, #path, #prepend_to, #remove, #remove_child, #text?, #traverse
Instance Attribute Details
#data ⇒ String (readonly)
Returns the data of the node.
17 18 19 |
# File 'opal/browser/dom/character_data.rb', line 17 def data `#@native.data` end |
#length ⇒ Integer (readonly)
Returns the length of the node.
47 |
# File 'opal/browser/dom/character_data.rb', line 47 alias_native :length |
Instance Method Details
#append(string) ⇒ self
Append data to the node.
9 10 11 12 13 |
# File 'opal/browser/dom/character_data.rb', line 9 def append(string) `#@native.appendData(string)` self end |
#delete(count, offset = 0) ⇒ self
Delete data from the node.
27 28 29 30 31 |
# File 'opal/browser/dom/character_data.rb', line 27 def delete(count, offset = 0) `#@native.deleteData(offset, count)` self end |
#insert(string, offset = 0) ⇒ self
Insert data in the node.
39 40 41 42 43 |
# File 'opal/browser/dom/character_data.rb', line 39 def insert(string, offset = 0) `#@native.insertData(offset, string)` self end |
#replace(string, offset = 0, count = `#@native.length`) ⇒ self
Replace data in the node.
56 57 58 59 60 |
# File 'opal/browser/dom/character_data.rb', line 56 def replace(string, offset = 0, count = `#@native.length`) `#@native.replaceData(offset, count, string)` self end |
#substring(count, offset = 0) ⇒ String
Get a substring of the data.
68 69 70 |
# File 'opal/browser/dom/character_data.rb', line 68 def substring(count, offset = 0) `#@native.substringData(offset, count)` end |