Class: Caricature::ClrClassDescriptor

Inherits:
TypeDescriptor show all
Includes:
ClrMemberCollector
Defined in:
lib/caricature/clr/descriptor.rb

Overview

Describes a CLR class type. it collects the properties and methods on an instance as well as on a static level

Instance Attribute Summary

Attributes inherited from TypeDescriptor

#class_members, #instance_members

Instance Method Summary collapse

Methods inherited from TypeDescriptor

#initialize

Constructor Details

This class inherits a constructor from Caricature::TypeDescriptor

Instance Method Details

#initialize_class_members_for(klass) ⇒ Object

collects all the static members of the provided CLR class type



82
83
84
85
86
87
88
89
# File 'lib/caricature/clr/descriptor.rb', line 82

def initialize_class_members_for(klass)
  clr_type = klass.to_clr_type

  methods = clr_type.get_methods(class_flags) 
  properties = clr_type.get_properties(class_flags) 

  @class_members = collect_members_from methods, properties, false
end

#initialize_instance_members_for(klass) ⇒ Object

collects all the instance members of the provided CLR class type



72
73
74
75
76
77
78
79
# File 'lib/caricature/clr/descriptor.rb', line 72

def initialize_instance_members_for(klass)
  clr_type = klass.to_clr_type

  methods = clr_type.get_methods(instance_flags) 
  properties = clr_type.get_properties(instance_flags) 

  @instance_members = collect_members_from methods, properties
end