Class: Orangutan::Reflector

Inherits:
Object show all
Defined in:
lib/orangutan/reflector.rb

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Reflector

Returns a new instance of Reflector.



2
3
4
# File 'lib/orangutan/reflector.rb', line 2

def initialize type
  @type = type.to_clr_type
end

Instance Method Details

#eventsObject



14
15
16
# File 'lib/orangutan/reflector.rb', line 14

def events
  @type.get_events.map { |info| info.name }
end

#methodsObject



6
7
8
# File 'lib/orangutan/reflector.rb', line 6

def methods
  @type.get_methods.map { |info| snake info.name }
end

#propertiesObject



10
11
12
# File 'lib/orangutan/reflector.rb', line 10

def properties
  @type.get_properties.map { |info| snake info.name }
end

#snake(text) ⇒ Object



18
19
20
# File 'lib/orangutan/reflector.rb', line 18

def snake text
  text.scan(/[A-Z][a-z0-9]*/).map {|a|a.downcase}.join('_').to_sym
end