Class: Tapioca::RBI::OptParam

Inherits:
Param show all
Extended by:
T::Sig
Defined in:
lib/tapioca/rbi/model.rb,
lib/tapioca/rbi/printer.rb

Direct Known Subclasses

KwOptParam

Instance Attribute Summary collapse

Attributes inherited from Param

#name

Attributes inherited from Node

#parent_tree

Instance Method Summary collapse

Methods inherited from Node

#detach, #group_kind, #oneline?, #print, #string

Constructor Details

#initialize(name, value) ⇒ OptParam

Returns a new instance of OptParam.



180
181
182
183
# File 'lib/tapioca/rbi/model.rb', line 180

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



177
178
179
# File 'lib/tapioca/rbi/model.rb', line 177

def value
  @value
end

Instance Method Details

#accept_printer(v) ⇒ Object



210
211
212
# File 'lib/tapioca/rbi/printer.rb', line 210

def accept_printer(v)
  v.print("#{name} = #{value}")
end