Class: Awestruct::Site

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

Constant Summary

Constants included from AStructMixin

AStructMixin::UNTRACKED_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AStruct

#hash

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
27
28
# File 'lib/awestruct/site.rb', line 20

def initialize(engine, config)
  @engine = engine
  @pages = []
  @layouts = Layouts.new
  @partials = []
  @config = config
  self.encoding = false
  @timestamp = Time.now.to_i
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



8
9
10
# File 'lib/awestruct/site.rb', line 8

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



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

def layouts
  @layouts
end

#output_dirObject (readonly)

Returns the value of attribute output_dir



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

def output_dir
  @output_dir
end

#pagesObject

Returns the value of attribute pages



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

def pages
  @pages
end

#partialsObject (readonly)

Returns the value of attribute partials



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

def partials
  @partials
end

#timestampObject (readonly)

Returns the value of attribute timestamp



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

def timestamp
  @timestamp
end

#tmp_dirObject (readonly)

Returns the value of attribute tmp_dir



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

def tmp_dir
  @tmp_dir
end

Instance Method Details

#inspectObject



30
31
32
# File 'lib/awestruct/site.rb', line 30

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

#load_page(path) ⇒ Object



46
47
48
# File 'lib/awestruct/site.rb', line 46

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