Class: Lazydoc::Trailer

Inherits:
Comment show all
Defined in:
lib/lazydoc/trailer.rb

Overview

A special type of self-resolving Comment that whose to_s returns the trailer, or an empty string if trailer is nil.

t = Trailer.new
t.subject = "def method  # trailer string"
t.to_s               # => "trailer string"

Instance Attribute Summary

Attributes inherited from Comment

#content, #document, #line_number, #subject

Instance Method Summary collapse

Methods inherited from Comment

#<<, #append, #comment, #empty?, #initialize, #parse_down, #parse_up, #prepend, #push, #resolve, #trailer, #trim, #unshift, #value, #value=, #wrap

Methods included from Utils

categorize, convert_to_scanner, determine_line_number, match_index, scan, scan_args, scan_index, scan_trailer, skip_quote, split_lines, wrap

Constructor Details

This class inherits a constructor from Lazydoc::Comment

Instance Method Details

#to_sObject

Self-resolves and returns trailer, or an empty string if trailer is nil.



14
15
16
17
# File 'lib/lazydoc/trailer.rb', line 14

def to_s
  resolve
  trailer.to_s
end