Module: Poms::HasBaseAttributes
Overview
Mixin for classes with a title and description.
Instance Method Summary collapse
Instance Method Details
#description ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/poms/has_base_attributes.rb', line 15 def description @description ||= begin descriptions.first.value rescue nil end end |
#title ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/poms/has_base_attributes.rb', line 4 def title return @title if @title main_title = select_title_by_type 'MAIN' sub_title = select_title_by_type 'SUB' if sub_title && sub_title.match(main_title) @titel = sub_title else @titel = [main_title, sub_title].compact.join(': ') end end |