Class: Awestruct::Site
Constant Summary
Constants included from AStructMixin
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
-
#layouts ⇒ Object
readonly
Returns the value of attribute layouts.
-
#output_dir ⇒ Object
readonly
Returns the value of attribute output_dir.
-
#pages ⇒ Object
Returns the value of attribute pages.
-
#partials ⇒ Object
readonly
Returns the value of attribute partials.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#tmp_dir ⇒ Object
readonly
Returns the value of attribute tmp_dir.
Instance Method Summary collapse
-
#initialize(engine, config) ⇒ Site
constructor
A new instance of Site.
- #inspect ⇒ Object
- #load_page(path) ⇒ Object
Methods inherited from AStruct
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
#config ⇒ Object (readonly)
Returns the value of attribute config.
17 18 19 |
# File 'lib/awestruct/site.rb', line 17 def config @config end |
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
8 9 10 |
# File 'lib/awestruct/site.rb', line 8 def dir @dir end |
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
18 19 20 |
# File 'lib/awestruct/site.rb', line 18 def engine @engine end |
#layouts ⇒ Object (readonly)
Returns the value of attribute layouts.
14 15 16 |
# File 'lib/awestruct/site.rb', line 14 def layouts @layouts end |
#output_dir ⇒ Object (readonly)
Returns the value of attribute output_dir.
9 10 11 |
# File 'lib/awestruct/site.rb', line 9 def output_dir @output_dir end |
#pages ⇒ Object
Returns the value of attribute pages.
13 14 15 |
# File 'lib/awestruct/site.rb', line 13 def pages @pages end |
#partials ⇒ Object (readonly)
Returns the value of attribute partials.
15 16 17 |
# File 'lib/awestruct/site.rb', line 15 def partials @partials end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
11 12 13 |
# File 'lib/awestruct/site.rb', line 11 def @timestamp end |
#tmp_dir ⇒ Object (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
#inspect ⇒ Object
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 |