Class: Fountain::Note
- Inherits:
-
Object
- Object
- Fountain::Note
- Defined in:
- lib/fountain/note.rb
Overview
Fountain Note
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
readonly
Raw note data.
Instance Method Summary collapse
-
#content ⇒ Object
Content.
-
#created_at ⇒ Object
Created at.
-
#id ⇒ Object
Note ID.
-
#initialize(data) ⇒ Note
constructor
A new instance of Note.
- #inspect ⇒ Object
-
#updated_at ⇒ Object
Updated at.
-
#user ⇒ Object
User.
Constructor Details
#initialize(data) ⇒ Note
Returns a new instance of Note.
14 15 16 |
# File 'lib/fountain/note.rb', line 14 def initialize(data) @raw_data = Util.stringify_hash_keys data end |
Instance Attribute Details
#raw_data ⇒ Object (readonly)
Raw note data
9 10 11 |
# File 'lib/fountain/note.rb', line 9 def raw_data @raw_data end |
Instance Method Details
#content ⇒ Object
Content
24 25 26 |
# File 'lib/fountain/note.rb', line 24 def content raw_data['content'] end |
#created_at ⇒ Object
Created at
29 30 31 |
# File 'lib/fountain/note.rb', line 29 def created_at Time.parse raw_data['created_at'] end |
#id ⇒ Object
Note ID
19 20 21 |
# File 'lib/fountain/note.rb', line 19 def id raw_data['id'] end |
#inspect ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/fountain/note.rb', line 45 def inspect format( '#<%<class_name>s:0x%<object_id>p @id="%<id>s">', class_name: self.class.name, object_id: object_id, id: id ) end |
#updated_at ⇒ Object
Updated at
34 35 36 |
# File 'lib/fountain/note.rb', line 34 def updated_at Time.parse raw_data['updated_at'] end |