Class: N::SitePage

Inherits:
Object show all
Defined in:
lib/nitro/ui/sitemap.rb

Overview

A single page in the page map.

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.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/nitro/ui/sitemap.rb', line 33

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.



26
27
28
# File 'lib/nitro/ui/sitemap.rb', line 26

def children
  @children
end

#descriptionObject

description of the page



25
26
27
# File 'lib/nitro/ui/sitemap.rb', line 25

def description
  @description
end

#flagObject

Returns the value of attribute flag.



27
28
29
# File 'lib/nitro/ui/sitemap.rb', line 27

def flag
  @flag
end

#levelObject

Returns the value of attribute level.



21
22
23
# File 'lib/nitro/ui/sitemap.rb', line 21

def level
  @level
end

#parentObject

Returns the value of attribute parent.



26
27
28
# File 'lib/nitro/ui/sitemap.rb', line 26

def parent
  @parent
end

#real_uriObject

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



15
16
17
# File 'lib/nitro/ui/sitemap.rb', line 15

def real_uri
  @real_uri
end

#realmObject

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



17
18
19
# File 'lib/nitro/ui/sitemap.rb', line 17

def realm
  @realm
end

#shaderObject

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



20
21
22
# File 'lib/nitro/ui/sitemap.rb', line 20

def shader
  @shader
end

#titleObject

title of the page



23
24
25
# File 'lib/nitro/ui/sitemap.rb', line 23

def title
  @title
end

#uriObject

the uri for this page



13
14
15
# File 'lib/nitro/ui/sitemap.rb', line 13

def uri
  @uri
end

Instance Method Details

#to_sObject

Return string representation



53
54
55
# File 'lib/nitro/ui/sitemap.rb', line 53

def to_s
	return @title
end