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.



8933
8934
8935
# File 'lib/syntax_tree.rb', line 8933

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

:nil | KwRestParam

the value of the parameter



8931
8932
8933
# File 'lib/syntax_tree.rb', line 8931

def value
  @value
end

Instance Method Details

#commentsObject



8937
8938
8939
# File 'lib/syntax_tree.rb', line 8937

def comments
  []
end

#format(q) ⇒ Object



8941
8942
8943
8944
8945
8946
8947
# File 'lib/syntax_tree.rb', line 8941

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