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.



5997
5998
5999
6000
# File 'lib/syntax_tree/node.rb', line 5997

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

Instance Attribute Details

#nameObject (readonly)

Ident

the name of the parameter



5992
5993
5994
# File 'lib/syntax_tree/node.rb', line 5992

def name
  @name
end

#valueObject (readonly)

nil | untyped

the value of the parameter



5995
5996
5997
# File 'lib/syntax_tree/node.rb', line 5995

def value
  @value
end

Instance Method Details

#commentsObject



6002
6003
6004
# File 'lib/syntax_tree/node.rb', line 6002

def comments
  []
end

#format(q) ⇒ Object



6006
6007
6008
6009
6010
6011
6012
6013
# File 'lib/syntax_tree/node.rb', line 6006

def format(q)
  q.format(name)

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