Class: Orangutan::Reflector
Instance Method Summary collapse
- #events ⇒ Object
-
#initialize(type) ⇒ Reflector
constructor
A new instance of Reflector.
- #methods ⇒ Object
- #properties ⇒ Object
- #snake(text) ⇒ Object
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
#events ⇒ Object
14 15 16 |
# File 'lib/orangutan/reflector.rb', line 14 def events @type.get_events.map { |info| info.name } end |
#methods ⇒ Object
6 7 8 |
# File 'lib/orangutan/reflector.rb', line 6 def methods @type.get_methods.map { |info| snake info.name } end |
#properties ⇒ Object
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 |