Class: BiteScript::ASM::MethodMirror

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

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) ⇒ MethodMirror

Returns a new instance of MethodMirror.



348
349
350
351
352
353
354
355
# File 'lib/bitescript/mirror.rb', line 348

def initialize(klass, flags, return_type, name, parameters, exceptions)
  @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.



347
348
349
# File 'lib/bitescript/mirror.rb', line 347

def argument_types
  @argument_types
end

#declaring_classObject (readonly)

Returns the value of attribute declaring_class.



346
347
348
# File 'lib/bitescript/mirror.rb', line 346

def declaring_class
  @declaring_class
end

#exception_typesObject (readonly)

Returns the value of attribute exception_types.



347
348
349
# File 'lib/bitescript/mirror.rb', line 347

def exception_types
  @exception_types
end

#nameObject (readonly)

Returns the value of attribute name.



346
347
348
# File 'lib/bitescript/mirror.rb', line 346

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



346
347
348
# File 'lib/bitescript/mirror.rb', line 346

def return_type
  @return_type
end

Instance Method Details

#inspectObject



357
358
359
360
361
362
363
364
365
# File 'lib/bitescript/mirror.rb', line 357

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