Class: Milksteak::Page

Inherits:
YmlContent show all
Defined in:
lib/models/page.rb

Instance Attribute Summary collapse

Attributes inherited from YmlContent

#content, #data, #file, #name, #output

Class Method Summary collapse

Methods inherited from YmlContent

list, load, #read_yaml, render, #render, #write_yaml

Instance Attribute Details

#routeObject

Returns the value of attribute route.



3
4
5
# File 'lib/models/page.rb', line 3

def route
  @route
end

Class Method Details

.folderObject



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

Raises:



11
12
13
14
# File 'lib/models/page.rb', line 11

def self.write(name, params = {}, content)
  raise NoRouteException unless params["route"]
  super
end