Class: Mirah::JVM::Types::Intrinsic

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

Direct Known Subclasses

ComparisonIntrinsic

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)


51
52
53
54
55
56
57
58
# File 'lib/mirah/jvm/types/methods.rb', line 51

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.



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

def argument_types
  @argument_types
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



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

def return_type
  @return_type
end

Instance Method Details

#abstract?Boolean

Returns:



76
77
78
# File 'lib/mirah/jvm/types/methods.rb', line 76

def abstract?
  false
end

#call(builder, ast, expression) ⇒ Object



60
61
62
# File 'lib/mirah/jvm/types/methods.rb', line 60

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

#constructor?Boolean

Returns:



68
69
70
# File 'lib/mirah/jvm/types/methods.rb', line 68

def constructor?
  false
end

#declaring_classObject



64
65
66
# File 'lib/mirah/jvm/types/methods.rb', line 64

def declaring_class
  @class
end

#exceptionsObject



80
81
82
# File 'lib/mirah/jvm/types/methods.rb', line 80

def exceptions
  []
end

#field?Boolean

Returns:



72
73
74
# File 'lib/mirah/jvm/types/methods.rb', line 72

def field?
  false
end