Module: Moxml::Text
- Includes:
- Node
- Defined in:
- lib/moxml/text.rb
Constant Summary
Constants included from NodeBehavior
Constants included from XmlUtils
Instance Attribute Summary
Attributes included from NodeBehavior
#context, #native, #parent_node
Instance Method Summary collapse
- #content ⇒ Object
- #content=(text) ⇒ Object
-
#raw_content ⇒ Object
Returns raw content without entity marker restoration.
- #to_s ⇒ Object
Methods included from Node
adapter, contract_module, contract_modules, node_type_map, wrap
Methods included from NodeBehavior
#==, #adapter, #add_child, #add_next_sibling, #add_previous_sibling, #after, #ancestors, #at_xpath, #before, #blank?, #children, #clear_native_memo!, #descendants, #digest, #document, #dup, #each, #each_node, #entity_bearing?, #find, #find_all, #first_child, #following_siblings, #has_children?, #identifier, #initialize, #invalidate_namespace_cache!, #last_child, #line_number, #materialize, #materialize_fields, #namespace, #namespaces, #next_sibling, #outer_xml, #parent, #path, #preceding_siblings, #previous_sibling, #prime_contract, #refresh_native!, #remove, #replace, #source_position, #text, #to_xml, #xpath
Methods included from XmlUtils
#encode_entities, #normalize_xml_value, #validate_comment_content, #validate_declaration_encoding, #validate_declaration_standalone, #validate_declaration_version, #validate_element_name, #validate_entity_reference_name, #validate_pi_target, #validate_prefix, #validate_uri
Instance Method Details
#content ⇒ Object
7 8 9 10 |
# File 'lib/moxml/text.rb', line 7 def content text = raw_content entity_bearing? ? adapter.restore_entities(text) : text end |
#content=(text) ⇒ Object
17 18 19 |
# File 'lib/moxml/text.rb', line 17 def content=(text) adapter.set_text_content(@native, normalize_xml_value(text)) end |
#raw_content ⇒ Object
Returns raw content without entity marker restoration.
13 14 15 |
# File 'lib/moxml/text.rb', line 13 def raw_content adapter.text_content(@native) end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/moxml/text.rb', line 21 def to_s content end |