class Todo::Data::Parser
Constants
- ID
- STATUS
- TAG
Public Instance Methods
parse()
click to toggle source
# File lib/todo/data/parser.rb, line 13 def parse { id: id, text: text, status: status, tags: tags, } end
Private Instance Methods
id()
click to toggle source
# File lib/todo/data/parser.rb, line 28 def id line =~ ID && $1.to_i end
status()
click to toggle source
# File lib/todo/data/parser.rb, line 24 def status STATUSES.invert[line.match(STATUS) && $1] end
text()
click to toggle source
# File lib/todo/data/parser.rb, line 32 def text line.sub(STATUS, '').gsub(ID, '').gsub(TAG, '').rstrip end