Class: Gnomika::Quote
- Inherits:
-
Object
- Object
- Gnomika::Quote
- Defined in:
- lib/gnomikologikon/quote.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
-
#initialize(content, author) ⇒ Quote
constructor
A new instance of Quote.
- #to_s ⇒ Object
Constructor Details
#initialize(content, author) ⇒ Quote
Returns a new instance of Quote.
5 6 7 8 |
# File 'lib/gnomikologikon/quote.rb', line 5 def initialize(content, ) @content = content @author = end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
3 4 5 |
# File 'lib/gnomikologikon/quote.rb', line 3 def @author end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
3 4 5 |
# File 'lib/gnomikologikon/quote.rb', line 3 def content @content end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 |
# File 'lib/gnomikologikon/quote.rb', line 10 def to_s str = "#{@content}" str << "\n - #{@author}" unless @author.strip.empty? str end |