Class: Configuration::Path
Defined Under Namespace
Classes: RenderedPath
Class Method Summary
collapse
Instance Method Summary
collapse
#add_missing_resolver, #initialize_copy, #to_template, #with_missing_resolver
Methods inherited from String
#to_template
Constructor Details
#initialize(path_name, template) ⇒ Path
Returns a new instance of Path.
Class Method Details
.match(node) ⇒ Object
33
34
35
|
# File 'lib/httpimagestore/configuration/path.rb', line 33
def self.match(node)
node.name == 'path'
end
|
.parse(configuration, node) ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/httpimagestore/configuration/path.rb', line 41
def self.parse(configuration, node)
nodes = []
nodes << node unless node.values.empty?
nodes |= node.children
nodes.empty? and raise NoValueError.new(node, 'path name')
nodes.each do |node|
path_name, template = *node.grab_values('path name', 'path template')
configuration.paths[path_name] = Path.new(path_name, template)
end
end
|
.pre(configuration) ⇒ Object
37
38
39
|
# File 'lib/httpimagestore/configuration/path.rb', line 37
def self.pre(configuration)
configuration.paths ||= Hash.new{|hash, path_name| raise PathNotDefinedError.new(path_name)}
end
|
Instance Method Details
#render(locals = {}) ⇒ Object
63
64
65
|
# File 'lib/httpimagestore/configuration/path.rb', line 63
def render(locals = {})
RenderedPath.new(super)
end
|