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.



5974
5975
5976
5977
# File 'lib/syntax_tree/node.rb', line 5974

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

Instance Attribute Details

#nameObject (readonly)

Ident

the name of the parameter



5969
5970
5971
# File 'lib/syntax_tree/node.rb', line 5969

def name
  @name
end

#valueObject (readonly)

untyped

the value of the parameter



5972
5973
5974
# File 'lib/syntax_tree/node.rb', line 5972

def value
  @value
end

Instance Method Details

#commentsObject



5979
5980
5981
# File 'lib/syntax_tree/node.rb', line 5979

def comments
  []
end

#format(q) ⇒ Object



5983
5984
5985
5986
5987
# File 'lib/syntax_tree/node.rb', line 5983

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