Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/core_ext/object.rb
Instance Method Summary collapse
-
#clr_type? ⇒ Boolean
returns whether this object is a clr_type.
-
#define_cmethod(name, &blk) ⇒ Object
defines a class method on an object.
-
#to_clr_type ⇒ Object
returns the clr type of this object if any.
Instance Method Details
#clr_type? ⇒ Boolean
returns whether this object is a clr_type. if it has a CLR type in one of its ancestors
5 6 7 |
# File 'lib/core_ext/object.rb', line 5 def clr_type? self.class.clr_type? end |
#define_cmethod(name, &blk) ⇒ Object
defines a class method on an object
15 16 17 |
# File 'lib/core_ext/object.rb', line 15 def define_cmethod(name, &blk) (class << self; self; end).instance_eval { define_method name, &blk } end |
#to_clr_type ⇒ Object
returns the clr type of this object if any
10 11 12 |
# File 'lib/core_ext/object.rb', line 10 def to_clr_type self.class.to_clr_type end |