Module: Gluttonberg::Content::BlockLocalization
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/gluttonberg/content/block_localization.rb
Overview
The mixin used when generating a localization for content classes. It adds the base properties — e.g. id — and associations. It also comes with some convenience methods for accessing the associated section in a page.
These just defer to the parent class.
Instance Method Summary collapse
- #association_name ⇒ Object
- #content_type ⇒ Object
- #page ⇒ Object
- #section_label ⇒ Object
- #section_name ⇒ Object
- #section_position ⇒ Object
Instance Method Details
#association_name ⇒ Object
16 17 18 |
# File 'lib/gluttonberg/content/block_localization.rb', line 16 def association_name self.class.association_name end |
#content_type ⇒ Object
20 21 22 |
# File 'lib/gluttonberg/content/block_localization.rb', line 20 def content_type self.class.content_type end |
#page ⇒ Object
36 37 38 |
# File 'lib/gluttonberg/content/block_localization.rb', line 36 def page self.page_localization.page end |
#section_label ⇒ Object
32 33 34 |
# File 'lib/gluttonberg/content/block_localization.rb', line 32 def section_label parent.section[:label] unless parent.blank? end |
#section_name ⇒ Object
24 25 26 |
# File 'lib/gluttonberg/content/block_localization.rb', line 24 def section_name parent.section[:name] if parent && parent.section end |
#section_position ⇒ Object
28 29 30 |
# File 'lib/gluttonberg/content/block_localization.rb', line 28 def section_position parent.section[:position] if parent && parent.section end |