Class: Rubyfocus::Context

Inherits:
RankedItem show all
Includes:
Parser
Defined in:
lib/rubyfocus/items/context.rb

Instance Attribute Summary collapse

Attributes inherited from RankedItem

#rank

Attributes inherited from NamedItem

#name

Attributes inherited from Item

#added, #document, #id, #modified

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Parser

included, parse

Methods inherited from RankedItem

#ancestry, #contained_within?

Methods inherited from NamedItem

#to_s

Methods inherited from Item

#initialize, #inspect, #to_serial

Methods included from ConditionalExec

#conditional_set

Methods included from IDRef

included

Constructor Details

This class inherits a constructor from Rubyfocus::Item

Instance Attribute Details

#locationObject

Returns the value of attribute location.



7
8
9
# File 'lib/rubyfocus/items/context.rb', line 7

def location
  @location
end

Class Method Details

.matches_node?(node) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/rubyfocus/items/context.rb', line 3

def self.matches_node?(node)
	return (node.name == "context")
end

Instance Method Details

#apply_xml(n) ⇒ Object



9
10
11
12
13
# File 'lib/rubyfocus/items/context.rb', line 9

def apply_xml(n)
	super(n)
	conditional_set(:container_id,n.at_xpath("xmlns:context")) { |e| e["idref"] }
	conditional_set(:location, 		n.at_xpath("xmlns:location")){ |e| Rubyfocus::Location.new(e) }
end