Class: Milksteak::Page
- Inherits:
-
YmlContent
- Object
- YmlContent
- Milksteak::Page
- Defined in:
- lib/models/page.rb
Instance Attribute Summary collapse
-
#route ⇒ Object
Returns the value of attribute route.
Attributes inherited from YmlContent
#content, #data, #file, #name, #output
Class Method Summary collapse
- .folder ⇒ Object
-
.write(name, params = {}, content) ⇒ Object
override write to include validation for :route.
Methods inherited from YmlContent
list, load, #read_yaml, render, #render, #write_yaml
Instance Attribute Details
#route ⇒ Object
Returns the value of attribute route.
3 4 5 |
# File 'lib/models/page.rb', line 3 def route @route end |
Class Method Details
.folder ⇒ Object
5 |
# File 'lib/models/page.rb', line 5 def self.folder; "pages"; end |
.write(name, params = {}, content) ⇒ Object
override write to include validation for :route. If validation becomes something that is needed on a bigger scale, we’ll need to put this into another method activerecord-style
11 12 13 14 |
# File 'lib/models/page.rb', line 11 def self.write(name, params = {}, content) raise NoRouteException unless params["route"] super end |