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)


36
37
38
39
40
41
42
43
# File 'lib/duby/jvm/types/methods.rb', line 36

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.



34
35
36
# File 'lib/duby/jvm/types/methods.rb', line 34

def argument_types
  @argument_types
end

#nameObject (readonly)

Returns the value of attribute name.



34
35
36
# File 'lib/duby/jvm/types/methods.rb', line 34

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



34
35
36
# File 'lib/duby/jvm/types/methods.rb', line 34

def return_type
  @return_type
end

Instance Method Details

#abstract?Boolean

Returns:



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

def abstract?
  false
end

#actual_return_typeObject



65
66
67
# File 'lib/duby/jvm/types/methods.rb', line 65

def actual_return_type
  return_type
end

#call(builder, ast, expression) ⇒ Object



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

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

#constructor?Boolean

Returns:



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

def constructor?
  false
end

#declaring_classObject



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

def declaring_class
  @class
end

#exceptionsObject



61
62
63
# File 'lib/duby/jvm/types/methods.rb', line 61

def exceptions
  []
end