Class: SyntaxTree::Params::KeywordFormatter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ KeywordFormatter

Returns a new instance of KeywordFormatter.



6539
6540
6541
6542
# File 'lib/syntax_tree/node.rb', line 6539

def initialize(name, value)
  @name = name
  @value = value
end

Instance Attribute Details

#nameObject (readonly)

Ident

the name of the parameter



6534
6535
6536
# File 'lib/syntax_tree/node.rb', line 6534

def name
  @name
end

#valueObject (readonly)

nil | untyped

the value of the parameter



6537
6538
6539
# File 'lib/syntax_tree/node.rb', line 6537

def value
  @value
end

Instance Method Details

#commentsObject



6544
6545
6546
# File 'lib/syntax_tree/node.rb', line 6544

def comments
  []
end

#format(q) ⇒ Object



6548
6549
6550
6551
6552
6553
6554
6555
# File 'lib/syntax_tree/node.rb', line 6548

def format(q)
  q.format(name)

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