ckuru-tools 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/ckuru-tools.rb +20 -0
  2. metadata +4 -4
data/lib/ckuru-tools.rb CHANGED
@@ -78,6 +78,26 @@ unless defined? CkuruTools
78
78
  CkuruTools.require_all_libs_relative_to __FILE__
79
79
  CkuruTools.require_all_libs_relative_to CkuruTools.libpath
80
80
 
81
+ #
82
+ # class Foo < ActiveRecord::Base
83
+ # end
84
+ #
85
+ # Foo.inherits_from? ActiveRecord::Base
86
+ # => true
87
+ #
88
+ class Class
89
+ def inherits_from?(klass)
90
+ raise ArgumentError.new("argument must be of type Class") unless klass.is_a? Class
91
+ if klass == self
92
+ true
93
+ elsif self.superclass.is_a? Class
94
+ self.superclass.inherits_from? klass
95
+ else
96
+ false
97
+ end
98
+ end
99
+ end
100
+
81
101
  class Array
82
102
  def to_comma_separated_string
83
103
  ret = ''
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ckuru-tools
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bret Weinraub
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-08 00:00:00 +00:00
18
+ date: 2010-11-12 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21