Class: Awestruct::Handlers::BaseHandler
- Inherits:
-
Object
- Object
- Awestruct::Handlers::BaseHandler
show all
- Defined in:
- lib/awestruct/handlers/base_handler.rb
Direct Known Subclasses
BaseSassHandler, FileHandler, FrontMatterHandler, HamlHandler, InterpolationHandler, LayoutHandler, MarkdownHandler, NoOpHandler, StringHandler, TextileHandler, YamlHandler
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(site, delegate = nil) ⇒ BaseHandler
Returns a new instance of BaseHandler.
11
12
13
14
|
# File 'lib/awestruct/handlers/base_handler.rb', line 11
def initialize(site, delegate=nil)
@site = site
@delegate = delegate
end
|
Instance Attribute Details
#delegate ⇒ Object
Returns the value of attribute delegate.
9
10
11
|
# File 'lib/awestruct/handlers/base_handler.rb', line 9
def delegate
@delegate
end
|
#site ⇒ Object
Returns the value of attribute site.
8
9
10
|
# File 'lib/awestruct/handlers/base_handler.rb', line 8
def site
@site
end
|
Instance Method Details
#content_line_offset ⇒ Object
75
76
77
78
|
# File 'lib/awestruct/handlers/base_handler.rb', line 75
def content_line_offset
return @delegate.content_line_offset if @delegate
0
end
|
#content_syntax ⇒ Object
60
61
62
63
|
# File 'lib/awestruct/handlers/base_handler.rb', line 60
def content_syntax
return @delegate.raw_content if @delegate
:none
end
|
#front_matter ⇒ Object
55
56
57
58
|
# File 'lib/awestruct/handlers/base_handler.rb', line 55
def front_matter
return @delegate.front_matter if @delegate
{}
end
|
#inherit_front_matter(page) ⇒ Object
80
81
82
|
# File 'lib/awestruct/handlers/base_handler.rb', line 80
def inherit_front_matter(page)
@delegate.inherit_front_matter(page) if @delegate
end
|
21
22
23
24
|
# File 'lib/awestruct/handlers/base_handler.rb', line 21
def input_mtime(page)
return @delegate.input_mtime(page) if @delegate
0
end
|
#output_extension ⇒ Object
45
46
47
48
|
# File 'lib/awestruct/handlers/base_handler.rb', line 45
def output_extension
return @delegate.output_extension if @delegate
File.extname( output_filename )
end
|
#output_filename ⇒ Object
36
37
38
39
|
# File 'lib/awestruct/handlers/base_handler.rb', line 36
def output_filename
return @delegate.output_filename if @delegate
nil
end
|
#output_path ⇒ Object
41
42
43
|
# File 'lib/awestruct/handlers/base_handler.rb', line 41
def output_path
File.join( File.dirname( relative_source_path ), output_filename )
end
|
#path ⇒ Object
50
51
52
53
|
# File 'lib/awestruct/handlers/base_handler.rb', line 50
def path
return @delegate.path if @delegate
nil
end
|
#raw_content ⇒ Object
65
66
67
68
|
# File 'lib/awestruct/handlers/base_handler.rb', line 65
def raw_content
return @delegate.raw_content if @delegate
nil
end
|
#relative_source_path ⇒ Object
31
32
33
34
|
# File 'lib/awestruct/handlers/base_handler.rb', line 31
def relative_source_path
return @delegate.relative_source_path if @delegate
nil
end
|
#rendered_content(context, with_layouts = true) ⇒ Object
70
71
72
73
|
# File 'lib/awestruct/handlers/base_handler.rb', line 70
def rendered_content(context, with_layouts=true)
return @delegate.rendered_content(context, with_layouts) if @delegate
nil
end
|
#simple_name ⇒ Object
26
27
28
29
|
# File 'lib/awestruct/handlers/base_handler.rb', line 26
def simple_name
return @delegate.simple_name if @delegate
nil
end
|
#stale? ⇒ Boolean
16
17
18
19
|
# File 'lib/awestruct/handlers/base_handler.rb', line 16
def stale?
return @delegate.stale? if @delegate
false
end
|
#to_chain ⇒ Object
84
85
86
87
88
|
# File 'lib/awestruct/handlers/base_handler.rb', line 84
def to_chain
chain = [ self ]
chain += @delegate.to_chain if @delegate
chain.flatten
end
|