Class: SyntaxTree::Params::KeywordRestFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ KeywordRestFormatter

Returns a new instance of KeywordRestFormatter.



9065
9066
9067
# File 'lib/syntax_tree.rb', line 9065

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

:nil | ArgsForward | KwRestParam

the value of the parameter



9063
9064
9065
# File 'lib/syntax_tree.rb', line 9063

def value
  @value
end

Instance Method Details

#commentsObject



9069
9070
9071
# File 'lib/syntax_tree.rb', line 9069

def comments
  []
end

#format(q) ⇒ Object



9073
9074
9075
9076
9077
9078
9079
# File 'lib/syntax_tree.rb', line 9073

def format(q)
  if value == :nil
    q.text("**nil")
  else
    q.format(value)
  end
end