Class: Todo::Data::Parser

Inherits:
Struct
  • Object
show all
Includes:
Helpers::Hash::Compact
Defined in:
lib/todo/data/parser.rb

Constant Summary collapse

STATUS =
/^(#{STATUSES.values.join('|')}){1}\s*/
ID =
/\s*\[(\d+)\]/
TAG =
/\s*([^\s]+):([^\s]+)/

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::Hash::Compact

#compact

Instance Attribute Details

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



6
7
8
# File 'lib/todo/data/parser.rb', line 6

def line
  @line
end

Instance Method Details

#parseObject



13
14
15
16
17
18
19
20
# File 'lib/todo/data/parser.rb', line 13

def parse
  {
    id: id,
    text: text,
    status: status,
    tags: tags,
  }
end