Class: SyntaxTree::RBS::MethodSignature::RequiredKeyword

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, param) ⇒ RequiredKeyword

Returns a new instance of RequiredKeyword.



258
259
260
261
# File 'lib/syntax_tree/rbs/utils.rb', line 258

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



256
257
258
# File 'lib/syntax_tree/rbs/utils.rb', line 256

def name
  @name
end

#paramObject (readonly)

Returns the value of attribute param.



256
257
258
# File 'lib/syntax_tree/rbs/utils.rb', line 256

def param
  @param
end

Instance Method Details

#format(q) ⇒ Object



263
264
265
266
267
# File 'lib/syntax_tree/rbs/utils.rb', line 263

def format(q)
  q.text(name)
  q.text(": ")
  param.format(q)
end