Class: HTree::Elem::Loc

Inherits:
Location show all
Includes:
Container::Loc, Trav
Defined in:
lib/htree/loc.rb,
lib/htree/modules.rb

Constant Summary

Constants included from HTree

DefaultContext, HTree::ElementContent, HTree::ElementExclusions, HTree::ElementInclusions, HTree::EmptyBindingObject, HTMLContext, NamedCharacters, NamedCharactersPattern, OmittedAttrName

Instance Attribute Summary

Attributes inherited from Location

#index, #node, #parent

Instance Method Summary collapse

Methods included from Trav

#attributes, #each_attr, #fetch_attr, #fetch_attribute, #get_attr, #get_attribute, #name, #qualified_name, #traverse_all_element, #traverse_some_element

Methods included from Container::Trav

#each_child, #each_child_with_index, #each_hyperlink, #each_hyperlink_uri, #each_uri, #filter, #find_element, #traverse_element, #traverse_text_internal

Methods included from Traverse

#bogusetag?, #comment?, #doc?, #doctype?, #elem?, #get_subnode, #procins?, #text?, #traverse_text, #xmldecl?

Methods included from Container::Loc

#children, #get_subnode_internal, #subst_subnode

Methods inherited from Location

#extract_text, #index_list, #initialize, #loc_list, #make_exact_equal_object, #make_loc, #path, #pretty_print, #subst, #subst_itself, #top

Methods included from HTree

#==, build_node, #check_equality, compile_template, #exact_equal?, #exact_equal_object, expand_template, fix_element, fix_structure_list, frozen_string, #hash, #make_exact_equal_object, #make_usual_equal_object, parse, parse_as, parse_pairs, parse_xml, scan, #usual_equal_object, with_frozen_string_hash

Constructor Details

This class inherits a constructor from HTree::Location

Instance Method Details

#contextObject



349
# File 'lib/htree/loc.rb', line 349

def context() @node.context end

#each_attributeObject

each_attribute iterates over each attributes.



357
358
359
360
361
362
# File 'lib/htree/loc.rb', line 357

def each_attribute
  @node.each_attribute {|attr_name, attr_text|
    attr_loc = get_subnode(attr_name)
    yield attr_name, attr_loc
  }
end

#element_nameObject

element_name returns the name of the element name as a Name object.



352
# File 'lib/htree/loc.rb', line 352

def element_name() @node.element_name end

#empty_element?Boolean

Returns:

  • (Boolean)


354
# File 'lib/htree/loc.rb', line 354

def empty_element?() @node.empty_element? end