Class: Cry::Codegen::CrystalFunction

Inherits:
Object
  • Object
show all
Defined in:
lib/cry/codegen/crystal_function.rb

Defined Under Namespace

Classes: Declaration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(declaration = '', initialization = '', definition = '') ⇒ CrystalFunction

Returns a new instance of CrystalFunction.



26
27
28
29
30
# File 'lib/cry/codegen/crystal_function.rb', line 26

def initialize(declaration = '', initialization = '', definition = '')
  @declaration = declaration
  @initialization = initialization
  @definition = definition
end

Instance Attribute Details

#declarationObject

Returns the value of attribute declaration.



24
25
26
# File 'lib/cry/codegen/crystal_function.rb', line 24

def declaration
  @declaration
end

#definitionObject

Returns the value of attribute definition.



24
25
26
# File 'lib/cry/codegen/crystal_function.rb', line 24

def definition
  @definition
end

Instance Method Details

#sourceObject



32
33
34
# File 'lib/cry/codegen/crystal_function.rb', line 32

def source
  [@declaration, @initialization, @definition].join("\n")
end