Class: Currently::Entry
- Inherits:
-
Object
- Object
- Currently::Entry
- Defined in:
- lib/currently/entry.rb
Instance Method Summary collapse
-
#initialize(text, contexts = [], ts = Time.now.to_s) ⇒ Entry
constructor
A new instance of Entry.
-
#serialize_to_line ⇒ Object
put this into sep module?.
- #to_s ⇒ Object
Constructor Details
#initialize(text, contexts = [], ts = Time.now.to_s) ⇒ Entry
Returns a new instance of Entry.
3 4 5 6 7 |
# File 'lib/currently/entry.rb', line 3 def initialize(text,contexts = [],ts = Time.now.to_s) @text = text @contexts = contexts @timestamp = ts end |
Instance Method Details
#serialize_to_line ⇒ Object
put this into sep module?
14 15 16 |
# File 'lib/currently/entry.rb', line 14 def serialize_to_line @timestamp.to_s + "| " + @text + " " + @contexts.map{|x| "#" + x}.join(" ") end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/currently/entry.rb', line 9 def to_s @text + @contexts.map{|x| "#" + x}.join(" ") end |