Parent

Class/Module Index [+]

Quicksearch

YARD::Parser::Ruby::Legacy::Statement

Attributes

block[R]
comments[R]
comments_hash_flag[RW]
comments_range[RW]
group[RW]

@deprecated Groups are now defined by directives @see Tags::GroupDirective

tokens[R]

Public Class Methods

new(tokens, block = nil, comments = nil) click to toggle source
# File lib/yard/parser/ruby/legacy/statement.rb, line 13
def initialize(tokens, block = nil, comments = nil)
  @tokens = tokens
  @block  = block
  @comments = comments
  @comments_hash_flag = false
end

Public Instance Methods

first_line() click to toggle source
# File lib/yard/parser/ruby/legacy/statement.rb, line 20
def first_line
  to_s.split(/\n/)[0]
end
inspect() click to toggle source
# File lib/yard/parser/ruby/legacy/statement.rb, line 31
def inspect
  l = line - 1
  to_s(false).split(/\n/).map do |text|
    "\t#{l += 1}:  #{text}"
  end.join("\n")
end
line() click to toggle source

@return [Fixnum] the first line of Ruby source

# File lib/yard/parser/ruby/legacy/statement.rb, line 43
def line
  tokens.first.line_no
end
line_range() click to toggle source

@return [Range<Fixnum>] the first to last lines of Ruby source @since 0.5.4

# File lib/yard/parser/ruby/legacy/statement.rb, line 49
def line_range
  tokens.first.line_no..tokens.last.line_no
end
show() click to toggle source
# File lib/yard/parser/ruby/legacy/statement.rb, line 38
def show
  "\t#{line}: #{first_line}"
end
source(include_block = true) click to toggle source
Alias for: to_s
to_s(include_block = true) click to toggle source
# File lib/yard/parser/ruby/legacy/statement.rb, line 24
def to_s(include_block = true)
  tokens.map do |token|
    RubyToken::TkBlockContents === token ? (include_block ? block.to_s : '') : token.text
  end.join
end
Also aliased as: source

[Validate]

Generated with the Darkfish Rdoc Generator 2.