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.



8442
8443
8444
8445
# File 'lib/syntax_tree.rb', line 8442

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

Instance Attribute Details

#nameObject (readonly)

Ident

the name of the parameter



8437
8438
8439
# File 'lib/syntax_tree.rb', line 8437

def name
  @name
end

#valueObject (readonly)

nil | untyped

the value of the parameter



8440
8441
8442
# File 'lib/syntax_tree.rb', line 8440

def value
  @value
end

Instance Method Details

#commentsObject



8447
8448
8449
# File 'lib/syntax_tree.rb', line 8447

def comments
  []
end

#format(q) ⇒ Object



8451
8452
8453
8454
8455
8456
8457
8458
# File 'lib/syntax_tree.rb', line 8451

def format(q)
  q.format(name)

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