class SyntaxTree::Params::KeywordFormatter

Formats the keyword position of the parameters. This includes the label, as well as an optional default value.

Attributes

name[R]
Ident

the name of the parameter

value[R]
nil | Node

the value of the parameter

Public Class Methods

new(name, value) click to toggle source
# File lib/syntax_tree/node.rb, line 8231
def initialize(name, value)
  @name = name
  @value = value
end

Public Instance Methods

comments() click to toggle source
# File lib/syntax_tree/node.rb, line 8236
def comments
  []
end
format(q) click to toggle source
# File lib/syntax_tree/node.rb, line 8240
def format(q)
  q.format(name)

  if value
    q.text(" ")
    q.format(value)
  end
end