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.



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

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

Instance Attribute Details

#name ⇒ Object (readonly)

[Ident] the name of the parameter



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

def name
  @name
end

#value ⇒ Object (readonly)

[untyped] the value of the parameter



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

def value
  @value
end

Instance Method Details

#comments ⇒ Object



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

def comments
  []
end

#format(q) ⇒ Object



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

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