Class: AboutPage::Configuration::Node
- Inherits:
-
Object
- Object
- AboutPage::Configuration::Node
show all
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/about_page/configuration.rb
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Class Attribute Details
.partial ⇒ Object
Returns the value of attribute partial.
85
86
87
|
# File 'lib/about_page/configuration.rb', line 85
def partial
@partial
end
|
Class Method Details
.render_with(partial) ⇒ Object
86
87
88
|
# File 'lib/about_page/configuration.rb', line 86
def render_with partial
@partial = partial
end
|
Instance Method Details
113
114
115
116
|
# File 'lib/about_page/configuration.rb', line 113
def response, text
response.['X-AboutPage-Warning'] ||= ""
response.['X-AboutPage-Warning'] += "#{self.class.name}: #{text};"
end
|
#expects(key) ⇒ Object
96
97
98
|
# File 'lib/about_page/configuration.rb', line 96
def expects key
@request_expectations["#{namespace}.#{key}"] || self.options[:expects][key] if @request_expectations
end
|
#messages ⇒ Object
100
101
102
103
|
# File 'lib/about_page/configuration.rb', line 100
def messages
run_validations!
errors.to_a.uniq
end
|
#preflight(request) ⇒ Object
91
92
93
94
|
# File 'lib/about_page/configuration.rb', line 91
def preflight request
errors.clear
@request_expectations = request.params.select { |k,v| k =~ /^#{namespace}\./ }
end
|
109
110
111
|
# File 'lib/about_page/configuration.rb', line 109
def response
messages.each { |m| (response, m) }
end
|
#to_h ⇒ Object
105
106
107
|
# File 'lib/about_page/configuration.rb', line 105
def to_h
nil
end
|