Class: CMS::Page
- Inherits:
-
Object
- Object
- CMS::Page
- Defined in:
- lib/cms/page.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
Instance Method Summary collapse
- #action ⇒ Object
- #editable? ⇒ Boolean
-
#initialize(route, options) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(route, options) ⇒ Page
Returns a new instance of Page.
4 5 6 7 8 9 10 |
# File 'lib/cms/page.rb', line 4 def initialize route, @options = .reverse_merge({ editable: true }) @name = route @route = ([:route] || route).dup end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/cms/page.rb', line 2 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
2 3 4 |
# File 'lib/cms/page.rb', line 2 def @options end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
2 3 4 |
# File 'lib/cms/page.rb', line 2 def route @route end |
Instance Method Details
#action ⇒ Object
12 13 14 |
# File 'lib/cms/page.rb', line 12 def action @action ||= ([:action] || route).dup end |
#editable? ⇒ Boolean
16 17 18 |
# File 'lib/cms/page.rb', line 16 def editable? ![:static] end |