Files

Caricature::ClrMemberCollector

Contains the logic to collect members from a CLR type

Private Instance Methods

class_flags() click to toggle source

the binding flags for class members of a CLR type

    # File lib/caricature/clr/descriptor.rb, line 37
37:       def class_flags
38:         System::Reflection::BindingFlags.public | System::Reflection::BindingFlags.static
39:       end
collect_members_from(meths, properties, instance_member=true) click to toggle source

collects the instance members for a CLR type. makes sure it can handle indexers for properties etc.

    # File lib/caricature/clr/descriptor.rb, line 9
 9:       def collect_members_from(meths, properties, instance_member=true)
10: 
11:         mem = []
12:         mem += meths.collect do |mi|
13:           MemberDescriptor.new(mi.name.underscore, mi.return_type, instance_member)
14:         end
15:         properties.each do |pi|
16:           prop_name = property_name_from(pi)
17:           mem << MemberDescriptor.new(prop_name, pi.property_type, instance_member)
18:           mem << MemberDescriptor.new("__setitem__", nil, instance_member) if prop_name == "__getitem__"
19:           mem << MemberDescriptor.new("#{prop_name}=", nil, instance_member) if pi.can_write and prop_name != "__getitem__"
20:         end
21:         mem
22:       end
instance_flags() click to toggle source

the binding flags for instance members of a CLR type

    # File lib/caricature/clr/descriptor.rb, line 32
32:       def instance_flags
33:         System::Reflection::BindingFlags.public | System::Reflection::BindingFlags.instance
34:       end
property_name_from(property_info) click to toggle source

gets the property name from the PropertyInfo when the property is an indexer it will return +[]+

    # File lib/caricature/clr/descriptor.rb, line 26
26:       def property_name_from(property_info)
27:         return property_info.name.underscore if property_info.get_index_parameters.empty?
28:         "__getitem__"
29:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.