Class: SyntaxTree::Params::KeywordFormatter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ KeywordFormatter

Returns a new instance of KeywordFormatter.



8833
8834
8835
8836
# File 'lib/syntax_tree.rb', line 8833

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

Instance Attribute Details

#nameObject (readonly)

Ident

the name of the parameter



8828
8829
8830
# File 'lib/syntax_tree.rb', line 8828

def name
  @name
end

#valueObject (readonly)

nil | untyped

the value of the parameter



8831
8832
8833
# File 'lib/syntax_tree.rb', line 8831

def value
  @value
end

Instance Method Details

#commentsObject



8838
8839
8840
# File 'lib/syntax_tree.rb', line 8838

def comments
  []
end

#format(q) ⇒ Object



8842
8843
8844
8845
8846
8847
8848
8849
# File 'lib/syntax_tree.rb', line 8842

def format(q)
  q.format(name)

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