Class: Duby::JVM::Types::Intrinsic

Inherits:
Object
  • Object
show all
Includes:
ArgumentConversion
Defined in:
lib/duby/jvm/types/methods.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ArgumentConversion

#convert_args

Constructor Details

#initialize(klass, name, args, type, &block) ⇒ Intrinsic

Returns a new instance of Intrinsic.

Raises:

  • (ArgumentError)


32
33
34
35
36
37
38
39
# File 'lib/duby/jvm/types/methods.rb', line 32

def initialize(klass, name, args, type, &block)
  raise ArgumentError, "Block required" unless block_given?
  @class = klass
  @name = name
  @argument_types = args
  @return_type = type
  @block = block
end

Instance Attribute Details

#argument_typesObject (readonly)

Returns the value of attribute argument_types.



30
31
32
# File 'lib/duby/jvm/types/methods.rb', line 30

def argument_types
  @argument_types
end

#nameObject (readonly)

Returns the value of attribute name.



30
31
32
# File 'lib/duby/jvm/types/methods.rb', line 30

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



30
31
32
# File 'lib/duby/jvm/types/methods.rb', line 30

def return_type
  @return_type
end

Instance Method Details

#actual_return_typeObject



57
58
59
# File 'lib/duby/jvm/types/methods.rb', line 57

def actual_return_type
  return_type
end

#call(builder, ast, expression) ⇒ Object



41
42
43
# File 'lib/duby/jvm/types/methods.rb', line 41

def call(builder, ast, expression)
  @block.call(builder, ast, expression)
end

#constructor?Boolean

Returns:



49
50
51
# File 'lib/duby/jvm/types/methods.rb', line 49

def constructor?
  false
end

#declaring_classObject



45
46
47
# File 'lib/duby/jvm/types/methods.rb', line 45

def declaring_class
  @class
end

#exceptionsObject



53
54
55
# File 'lib/duby/jvm/types/methods.rb', line 53

def exceptions
  []
end