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 included from ClrMemberCollector

#class_events, #events

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



147
148
149
150
151
152
153
154
155
156
# File 'lib/caricature/clr/descriptor.rb', line 147

def initialize_class_members_for(klass)
  clr_type = klass.to_clr_type

  context = {}
  context[:methods] = clr_type.get_methods(class_flags)
  context[:properties] = clr_type.get_properties(class_flags)
  context[:events] = clr_type.get_events(class_event_flags)

  @class_members = build_member_collections context, false
end

#initialize_instance_members_for(klass) ⇒ Object

collects all the instance members of the provided CLR class type



135
136
137
138
139
140
141
142
143
144
# File 'lib/caricature/clr/descriptor.rb', line 135

def initialize_instance_members_for(klass)
  clr_type = klass.to_clr_type

  context = {}
  context[:methods] = clr_type.get_methods(instance_flags)
  context[:properties] = clr_type.get_properties(instance_flags)
  context[:events] = clr_type.get_events(event_flags)

  @instance_members = build_member_collections context
end