Class: Dust::Builder::Page
- Inherits:
-
Object
- Object
- Dust::Builder::Page
- Defined in:
- app/models/dust/builder/page.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Page
constructor
A new instance of Page.
- #save ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Page
Returns a new instance of Page.
5 6 7 8 9 |
# File 'app/models/dust/builder/page.rb', line 5 def initialize(={}) @page = [:page] @sections = [:sections] || [] @page_attrs = [:attrs] if [:attrs] end |
Instance Method Details
#save ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/models/dust/builder/page.rb', line 11 def save build_sections update_blocks if @page.errors.blank? @page.save else false end end |
#update ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'app/models/dust/builder/page.rb', line 21 def update build_sections update_blocks if @page.errors.blank? @page.update_attributes(@page_attrs) else false end end |