class ReVIEW::CodeBlockElementNode

Attributes

args[R]
compiler[R]
content[R]
name[R]
position[R]

Public Class Methods

new(compiler, position, name, args, content) click to toggle source
# File lib/review/compiler.rb, line 913
def initialize(compiler, position, name, args, content)
  @compiler = compiler
  @position = position
  @name = name
  @args = args
  @content = content
end

Public Instance Methods

parse_args(*patterns) click to toggle source
# File lib/review/node.rb, line 114
def parse_args(*patterns)
  patterns.map.with_index do |pattern, i|
    if @args[i]
      @args[i].__send__("to_#{pattern}")
    else
      nil
    end
  end
end
raw_lines() click to toggle source
# File lib/review/node.rb, line 124
def raw_lines
  self.content.to_doc.split(/\n/)
end
to_doc() click to toggle source
# File lib/review/node.rb, line 103
def to_doc
  # content_str = super
  args = @args.map(&:to_doc)
  if @content
    content_lines = raw_lines
  else
    content_lines = nil
  end
  @compiler.compile_command(@name, @args, content_lines, self)
end