Class: OpenHAB::CoreExt::Java::Class
- Inherits:
-
Object
- Object
- OpenHAB::CoreExt::Java::Class
- Defined in:
- lib/openhab/core_ext/java/class.rb
Overview
Extensions to Class
Instance Method Summary collapse
-
#ancestors ⇒ Array<Class>
self
, all superclasses and interfaces, recursively. -
#generic_ancestors ⇒ Array<java.lang.reflect.Type>
self
, all superclasses and interfaces, recursively.
Instance Method Details
#ancestors ⇒ Array<Class>
self
, all superclasses and interfaces, recursively.
15 16 17 18 19 |
# File 'lib/openhab/core_ext/java/class.rb', line 15 def ancestors ([self] + Array(superclass&.ancestors) + interfaces.flat_map(&:ancestors)).uniq end |
#generic_ancestors ⇒ Array<java.lang.reflect.Type>
self
, all superclasses and interfaces, recursively.
26 27 28 29 30 |
# File 'lib/openhab/core_ext/java/class.rb', line 26 def generic_ancestors ancestors.flat_map do |klass| Array(klass.generic_superclass) + klass.generic_interfaces end.uniq end |