Class: Awestruct::Site

Inherits:
AStruct
  • Object
show all
Defined in:
lib/awestruct/site.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AStructMixin

#[], #cascade_for_nils!, extended, #key?, #method_missing, #transform_entry

Constructor Details

#initialize(engine, config) ⇒ Site

Returns a new instance of Site.



20
21
22
23
24
25
26
# File 'lib/awestruct/site.rb', line 20

def initialize(engine, config)
  @engine = engine
  @pages = []
  @layouts = Layouts.new
  @config = config
  self.encoding = false
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Awestruct::AStructMixin

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



17
18
19
# File 'lib/awestruct/site.rb', line 17

def config
  @config
end

#dirObject (readonly)

Returns the value of attribute dir.



10
11
12
# File 'lib/awestruct/site.rb', line 10

def dir
  @dir
end

#engineObject (readonly)

Returns the value of attribute engine.



18
19
20
# File 'lib/awestruct/site.rb', line 18

def engine
  @engine
end

#layoutsObject (readonly)

Returns the value of attribute layouts.



15
16
17
# File 'lib/awestruct/site.rb', line 15

def layouts
  @layouts
end

#output_dirObject (readonly)

Returns the value of attribute output_dir.



11
12
13
# File 'lib/awestruct/site.rb', line 11

def output_dir
  @output_dir
end

#pagesObject (readonly)

Returns the value of attribute pages.



14
15
16
# File 'lib/awestruct/site.rb', line 14

def pages
  @pages
end

#tmp_dirObject (readonly)

Returns the value of attribute tmp_dir.



12
13
14
# File 'lib/awestruct/site.rb', line 12

def tmp_dir
  @tmp_dir
end

Instance Method Details

#inspectObject



28
29
30
# File 'lib/awestruct/site.rb', line 28

def inspect
  "Site{:dir=>#{dir}}"
end

#load_page(path) ⇒ Object



44
45
46
# File 'lib/awestruct/site.rb', line 44

def load_page(path)
  engine.load_path( self, path )
end