Module: Caty::HasDescription
- Included in:
- GlobalOption, Task
- Defined in:
- lib/caty/has_description.rb
Overview
Mixin for everything that can has description ;-)
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
Instance Method Summary collapse
-
#short_description ⇒ Object
If a description was set for this object, this will return the first line of that desciption.
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
10 11 12 |
# File 'lib/caty/has_description.rb', line 10 def description @description end |
Instance Method Details
#short_description ⇒ Object
If a description was set for this object, this will return the first line of that desciption. Else nil will be returned.
17 18 19 20 21 22 23 |
# File 'lib/caty/has_description.rb', line 17 def short_description if self.description.nil? nil else self.description[%r{^[^\n\r]*}] end end |