Class: BiteScript::ASM::MethodMirror

Inherits:
Object
  • Object
show all
Includes:
Annotated, Modifiers
Defined in:
lib/bitescript/mirror.rb,
lib/bitescript/asm3/mirror.rb

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Attributes included from Modifiers

#flags

Instance Method Summary collapse

Methods included from Annotated

#addAnnotation, #annotations, #declaredAnnotations, #getDeclaredAnnotation, #inspect_annotations

Methods included from Modifiers

add_modifier

Constructor Details

#initialize(klass, flags, return_type, name, parameters, exceptions, signature) ⇒ MethodMirror

Returns a new instance of MethodMirror.



396
397
398
399
400
401
402
403
# File 'lib/bitescript/mirror.rb', line 396

def initialize(klass, flags, return_type, name, parameters, exceptions, signature)
  @flags = flags
  @declaring_class = klass
  @name = name
  @return_type = return_type
  @argument_types = parameters
  @exception_types = exceptions
end

Instance Attribute Details

#argument_typesObject (readonly)

Returns the value of attribute argument_types.



394
395
396
# File 'lib/bitescript/mirror.rb', line 394

def argument_types
  @argument_types
end

#declaring_classObject (readonly)

Returns the value of attribute declaring_class.



393
394
395
# File 'lib/bitescript/mirror.rb', line 393

def declaring_class
  @declaring_class
end

#exception_typesObject (readonly)

Returns the value of attribute exception_types.



394
395
396
# File 'lib/bitescript/mirror.rb', line 394

def exception_types
  @exception_types
end

#nameObject (readonly)

Returns the value of attribute name.



393
394
395
# File 'lib/bitescript/mirror.rb', line 393

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



393
394
395
# File 'lib/bitescript/mirror.rb', line 393

def return_type
  @return_type
end

#signatureObject (readonly)

Returns the value of attribute signature.



394
395
396
# File 'lib/bitescript/mirror.rb', line 394

def signature
  @signature
end

Instance Method Details

#generic_exception_typesObject



413
414
415
# File 'lib/bitescript/mirror.rb', line 413

def generic_exception_types
  signature.exception_types if signature
end

#generic_parameter_typesObject



405
406
407
# File 'lib/bitescript/mirror.rb', line 405

def generic_parameter_types
  signature.parameter_types if signature
end

#generic_return_typeObject



409
410
411
# File 'lib/bitescript/mirror.rb', line 409

def generic_return_type
  signature.return_type if signature
end

#inspectObject



421
422
423
424
425
426
427
428
429
# File 'lib/bitescript/mirror.rb', line 421

def inspect
  "%s%s%s %s(%s);" % [
    inspect_annotations,
    modifier_string,
    return_type.class_name,
    name,
    argument_types.map {|x| x.class_name}.join(', '),
  ]
end

#type_parametersObject



417
418
419
# File 'lib/bitescript/mirror.rb', line 417

def type_parameters
  signature.type_parameters is signature
end