Class: N::SitePage

Inherits:
Object
  • Object
show all
Defined in:
lib/n/sitemap.rb

Overview

SitePage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, title = nil, parent = nil, realm = nil) ⇒ SitePage

Returns a new instance of SitePage.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/n/sitemap.rb', line 54

def initialize(uri, title = nil, parent = nil, realm = nil)
	@uri, @title, @parent = uri, title, parent

	# inherit realm from parent if exists
	if parent and parent.realm
		@realm = parent.realm 
	else
		@realm = realm
	end

	@children = []
	@parent.children << self if parent

	# gmosx: is this good?
	# automatically add to the sitemap.		
	$sitemap << self		
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



47
48
49
# File 'lib/n/sitemap.rb', line 47

def children
  @children
end

#descriptionObject

description of the page



46
47
48
# File 'lib/n/sitemap.rb', line 46

def description
  @description
end

#flagObject

Returns the value of attribute flag.



48
49
50
# File 'lib/n/sitemap.rb', line 48

def flag
  @flag
end

#levelObject

Returns the value of attribute level.



42
43
44
# File 'lib/n/sitemap.rb', line 42

def level
  @level
end

#parentObject

Returns the value of attribute parent.



47
48
49
# File 'lib/n/sitemap.rb', line 47

def parent
  @parent
end

#real_uriObject

the real uri to this page calculated by the page overloader)



37
38
39
# File 'lib/n/sitemap.rb', line 37

def real_uri
  @real_uri
end

#realmObject

the realm this page belongs to, typically the part name. put symbols in this variable



52
53
54
# File 'lib/n/sitemap.rb', line 52

def realm
  @realm
end

#shaderObject

the shader for this page, overrided the shader calculated by the engine



41
42
43
# File 'lib/n/sitemap.rb', line 41

def shader
  @shader
end

#titleObject

title of the page



44
45
46
# File 'lib/n/sitemap.rb', line 44

def title
  @title
end

#uriObject

the uri for this page



35
36
37
# File 'lib/n/sitemap.rb', line 35

def uri
  @uri
end

Instance Method Details

#to_sObject

Return string representation



74
75
76
# File 'lib/n/sitemap.rb', line 74

def to_s
	return @title
end