Class: Sticky::Note
- Inherits:
-
Object
- Object
- Sticky::Note
- Defined in:
- lib/sticky/note.rb
Instance Attribute Summary collapse
-
#db ⇒ Object
Returns the value of attribute db.
-
#message ⇒ Object
Returns the value of attribute message.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Class Method Summary collapse
- .build(message, tag = nil, db = Sticky::Store.new) ⇒ Object
- .delete!(tag, db = Sticky::Store.new) ⇒ Object
- .show(tag, date, db = Sticky::Store.new) ⇒ Object
Instance Method Summary collapse
-
#initialize(message, tag, db, timestamp = Time.now) ⇒ Note
constructor
A new instance of Note.
- #save! ⇒ Object
- #to_yaml_properties ⇒ Object
Constructor Details
#initialize(message, tag, db, timestamp = Time.now) ⇒ Note
Returns a new instance of Note.
23 24 25 26 27 28 |
# File 'lib/sticky/note.rb', line 23 def initialize(, tag, db, = Time.now) @message = @db = db @tag = tag @timestamp = end |
Instance Attribute Details
#db ⇒ Object
Returns the value of attribute db.
5 6 7 |
# File 'lib/sticky/note.rb', line 5 def db @db end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/sticky/note.rb', line 5 def @message end |
#tag ⇒ Object
Returns the value of attribute tag.
5 6 7 |
# File 'lib/sticky/note.rb', line 5 def tag @tag end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
5 6 7 |
# File 'lib/sticky/note.rb', line 5 def @timestamp end |
Class Method Details
.build(message, tag = nil, db = Sticky::Store.new) ⇒ Object
8 9 10 |
# File 'lib/sticky/note.rb', line 8 def build(, tag = nil, db = Sticky::Store.new) new(, tag, db) end |
Instance Method Details
#save! ⇒ Object
30 31 32 |
# File 'lib/sticky/note.rb', line 30 def save! db.save!(self) end |
#to_yaml_properties ⇒ Object
34 35 36 |
# File 'lib/sticky/note.rb', line 34 def to_yaml_properties [:@message, :@tag, :@timestamp] end |