Module: GroupedPage::InstanceMethods
- Defined in:
- lib/grouped_page.rb
Instance Attribute Summary collapse
-
#inherited_groups ⇒ Object
readonly
Returns the value of attribute inherited_groups.
Instance Method Summary collapse
- #cache? ⇒ Boolean
- #group_is_inherited?(group) ⇒ Boolean
- #has_inherited_group?(group) ⇒ Boolean
- #permitted_groups_with_inheritance ⇒ Object
Instance Attribute Details
#inherited_groups ⇒ Object (readonly)
Returns the value of attribute inherited_groups.
14 15 16 |
# File 'lib/grouped_page.rb', line 14 def inherited_groups @inherited_groups end |
Instance Method Details
#cache? ⇒ Boolean
23 24 25 |
# File 'lib/grouped_page.rb', line 23 def cache? self.permitted_groups.empty? end |
#group_is_inherited?(group) ⇒ Boolean
31 32 33 |
# File 'lib/grouped_page.rb', line 31 def group_is_inherited?(group) return self.has_inherited_group?(group) && !self.has_group?(group) end |
#has_inherited_group?(group) ⇒ Boolean
27 28 29 |
# File 'lib/grouped_page.rb', line 27 def has_inherited_group?(group) return self.inherited_groups.include?(group) end |
#permitted_groups_with_inheritance ⇒ Object
19 20 21 |
# File 'lib/grouped_page.rb', line 19 def permitted_groups_with_inheritance permitted_groups_without_inheritance + inherited_groups end |