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.



8810
8811
8812
8813
# File 'lib/syntax_tree.rb', line 8810

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

Instance Attribute Details

#nameObject (readonly)

Ident

the name of the parameter



8805
8806
8807
# File 'lib/syntax_tree.rb', line 8805

def name
  @name
end

#valueObject (readonly)

untyped

the value of the parameter



8808
8809
8810
# File 'lib/syntax_tree.rb', line 8808

def value
  @value
end

Instance Method Details

#commentsObject



8815
8816
8817
# File 'lib/syntax_tree.rb', line 8815

def comments
  []
end

#format(q) ⇒ Object



8819
8820
8821
8822
8823
# File 'lib/syntax_tree.rb', line 8819

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