Class: Chelsy::Param

Inherits:
Element show all
Defined in:
lib/chelsy/ast.rb

Overview

Function and prototype params

Instance Attribute Summary collapse

Attributes inherited from Element

#fragments, #post_fragments

Instance Method Summary collapse

Constructor Details

#initialize(name, type, register: false, **rest) ⇒ Param

Returns a new instance of Param.



279
280
281
282
283
284
# File 'lib/chelsy/ast.rb', line 279

def initialize(name, type, register: false, **rest)
  @name = Syntax::Ident.ensure(name)
  @type = Syntax::Type.ensure(type)

  super(**rest)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



277
278
279
# File 'lib/chelsy/ast.rb', line 277

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



277
278
279
# File 'lib/chelsy/ast.rb', line 277

def type
  @type
end