Class: SyntaxTree::Params::OptionalFormatter

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) ⇒ OptionalFormatter

Returns a new instance of OptionalFormatter.



6516
6517
6518
6519
# File 'lib/syntax_tree/node.rb', line 6516

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

Instance Attribute Details

#nameObject (readonly)

Ident

the name of the parameter



6511
6512
6513
# File 'lib/syntax_tree/node.rb', line 6511

def name
  @name
end

#valueObject (readonly)

untyped

the value of the parameter



6514
6515
6516
# File 'lib/syntax_tree/node.rb', line 6514

def value
  @value
end

Instance Method Details

#commentsObject



6521
6522
6523
# File 'lib/syntax_tree/node.rb', line 6521

def comments
  []
end

#format(q) ⇒ Object



6525
6526
6527
6528
6529
# File 'lib/syntax_tree/node.rb', line 6525

def format(q)
  q.format(name)
  q.text(" = ")
  q.format(value)
end