Sha256: 446639fe19dd252a927291200eaf55d7bc477d136e62e65646bc21b3c0942868

Contents?: true

Size: 414 Bytes

Versions: 1

Compression:

Stored size: 414 Bytes

Contents

module TodoNext

  class Line
    attr_accessor :text, :col_offset, :leaf

    def initialize(text, col_offset)
      @text, @col_offset = text, col_offset
    end

    def to_s
      "<Line# text:#{text}, leaf:#{leaf}, col_offset:#{col_offset}>"
    end

    def blank?
      text =~ /^\s*$/
    end
    def comment?
      text =~ /^#/
    end

    def leaf?   ; leaf   end
    def branch? ; !leaf? end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
todo_next-0.0.1 lib/todo_next/line.rb