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

def initialize(engine, config)
  @engine = engine
  @pages = []
  @layouts = Layouts.new
  @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.



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

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.



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

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

#timestampObject (readonly)

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end

#tmp_dirObject (readonly)

Returns the value of attribute tmp_dir.



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

def tmp_dir
  @tmp_dir
end

Instance Method Details

#inspectObject



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

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

#load_page(path) ⇒ Object



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

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