Class: Todo::Task
- Inherits:
-
Object
- Object
- Todo::Task
- Defined in:
- lib/tasky.rb
Defined Under Namespace
Classes: InvalidStatus
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
Class Method Summary collapse
-
.file ⇒ Object
wrapper to Task#file with a dummy task.
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize(message) ⇒ Task
constructor
A new instance of Task.
- #save ⇒ Object
- #size ⇒ Object
Constructor Details
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
81 82 83 |
# File 'lib/tasky.rb', line 81 def @message end |
Class Method Details
.file ⇒ Object
wrapper to Task#file with a dummy task
109 110 111 |
# File 'lib/tasky.rb', line 109 def self.file new([?.]).file end |
Instance Method Details
#file ⇒ Object
104 105 106 |
# File 'lib/tasky.rb', line 104 def file File.(File.join('~', '.todo')) end |
#save ⇒ Object
92 93 94 95 96 97 98 |
# File 'lib/tasky.rb', line 92 def save File.open(file, 'a') do |f| f.puts end File.size(file) end |
#size ⇒ Object
100 101 102 |
# File 'lib/tasky.rb', line 100 def size .size end |