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.



8856
8857
8858
# File 'lib/syntax_tree.rb', line 8856

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

:nil | KwRestParam

the value of the parameter



8854
8855
8856
# File 'lib/syntax_tree.rb', line 8854

def value
  @value
end

Instance Method Details

#commentsObject



8860
8861
8862
# File 'lib/syntax_tree.rb', line 8860

def comments
  []
end

#format(q) ⇒ Object



8864
8865
8866
8867
8868
8869
8870
# File 'lib/syntax_tree.rb', line 8864

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