Class: Cooklang::Note
- Inherits:
-
Object
- Object
- Cooklang::Note
- Defined in:
- lib/cooklang/note.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(content:) ⇒ Note
constructor
A new instance of Note.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(content:) ⇒ Note
7 8 9 |
# File 'lib/cooklang/note.rb', line 7 def initialize(content:) @content = content.to_s.freeze end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
5 6 7 |
# File 'lib/cooklang/note.rb', line 5 def content @content end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/cooklang/note.rb', line 19 def ==(other) other.is_a?(Note) && content == other.content end |
#hash ⇒ Object
23 24 25 |
# File 'lib/cooklang/note.rb', line 23 def hash content.hash end |
#to_h ⇒ Object
15 16 17 |
# File 'lib/cooklang/note.rb', line 15 def to_h { content: content } end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/cooklang/note.rb', line 11 def to_s content end |