class Shaf::ApiDoc::Comment

Public Class Methods

new() click to toggle source
# File lib/shaf/api_doc/comment.rb, line 4
def initialize
  @indent = 0
  @comment = ""
end

Public Instance Methods

<<(line) click to toggle source
# File lib/shaf/api_doc/comment.rb, line 17
def <<(line)
  @indent = line[/\A\s*/].size if empty?
  @comment << "\n#{extract(line)}"
end
empty?() click to toggle source
# File lib/shaf/api_doc/comment.rb, line 13
def empty?
  @comment.empty?
end
extract(line) click to toggle source
# File lib/shaf/api_doc/comment.rb, line 22
def extract(line)
  line.sub(%r(\A\s{#{@indent}}), "")
end
to_s() click to toggle source
# File lib/shaf/api_doc/comment.rb, line 9
def to_s
  @comment
end