class Crystal::Macros::Primitive

Overview

A fictitious node representing the body of a Def marked with @[Primitive].

Defined in:

compiler/crystal/macros.cr

Instance Method Summary

Instance Method Detail

def name : SymbolLiteral #

Returns the name of the primitive.

This is identical to the argument to the associated @[Primitive] annotation.

module Foo
  @[Primitive(:abc)]
  def foo
  end
end

{{ Foo.methods.first.body.name }} # => :abc

[View source]