Class: SyntaxTree::Params::KeywordRestFormatter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ KeywordRestFormatter

Returns a new instance of KeywordRestFormatter.



7822
7823
7824
# File 'lib/syntax_tree/node.rb', line 7822

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

[:nil | ArgsForward | KwRestParam] the value of the parameter



7820
7821
7822
# File 'lib/syntax_tree/node.rb', line 7820

def value
  @value
end

Instance Method Details

#commentsObject



7826
7827
7828
# File 'lib/syntax_tree/node.rb', line 7826

def comments
  []
end

#format(q) ⇒ Object



7830
7831
7832
7833
7834
7835
7836
# File 'lib/syntax_tree/node.rb', line 7830

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