Class: SyntaxTree::Params::OptionalFormatter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ OptionalFormatter

Returns a new instance of OptionalFormatter.



8887
8888
8889
8890
# File 'lib/syntax_tree.rb', line 8887

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

Instance Attribute Details

#nameObject (readonly)

Ident

the name of the parameter



8882
8883
8884
# File 'lib/syntax_tree.rb', line 8882

def name
  @name
end

#valueObject (readonly)

untyped

the value of the parameter



8885
8886
8887
# File 'lib/syntax_tree.rb', line 8885

def value
  @value
end

Instance Method Details

#commentsObject



8892
8893
8894
# File 'lib/syntax_tree.rb', line 8892

def comments
  []
end

#format(q) ⇒ Object



8896
8897
8898
8899
8900
# File 'lib/syntax_tree.rb', line 8896

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