Skip to content

class Crystal::Doc::Method
inherits Reference

Included modules

Crystal::Doc::Item

Constants

PSEUDO_METHOD_NOTE = "\nNOTE: This is a pseudo-method provided directly by the Crystal compiler.\nIt cannot be redefined nor overridden."

PSEUDO_METHOD_PREFIX = "__crystal_pseudo_"

Class methods

.new(generator : Generator, type : Type, def __arg0 : Def, class_method : Bool)

View source

Methods

#abstract?

View source

#anchor

View source

#annotations(annotation_type)

View source

#arg_to_html(arg : Arg, io, links = true)

View source

#args

View source

#args_to_html

View source

#args_to_html(io : IO, links : Bool = true) : Nil

View source

#args_to_s

View source

#args_to_s(io : IO) : Nil

View source

#constructor?

View source

#def : Def

View source

#doc

Returns this method's docs ready to be shown (before formatting) in the UI. This includes copying docs from previous def or ancestors and replacing :inherit: with the ancestor docs. This docs not include the "Description copied from ..." banner in case it's needed.

View source

#doc_copied_from : Type?

Returns the type this method's docs are copied from, but only if this method has no docs at all. In this case the docs will be copied from this type and a "Description copied from ..." will be added before the docs.

View source

#has_args?

View source

#html_id

View source

#kind

View source

#location

View source

#must_be_included?

View source

#name

View source

#node_to_html(node, io, links = true)

View source

#prefix

View source

#return_type

View source

#to_json(builder : JSON::Builder)

View source

#to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
View source

#type : Type

View source