standard_exceptions 0.1.4 → 0.1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3c79d3a622b6ed754de32bbb8c5eb1ff957320d
4
- data.tar.gz: 08bd055ee0bdf77b115634cd68647268c7d7c6b3
3
+ metadata.gz: 2fab5039aaf71e6eb949c2cc8537744d11a9d0e4
4
+ data.tar.gz: 8d1c0b30348e8e0c2dec97875db2824ca2ee6307
5
5
  SHA512:
6
- metadata.gz: 27a042fbcc943af2217b8d8352de8258e77214ca45c975c3909fb82da3c866d0feaf75508edbe3f72a56a09b68f23b82c43121e7a4a149a0382475890a455d0e
7
- data.tar.gz: 8bb3ddf08b5f1615ddb2f55e1b45fdd8cdb2cdd63c64d8df7036c2189ce8f8a6c1fb99c860f9e3f9d081ac04ca321d3620711467b3baa3fb785770bbc3c2f9af
6
+ metadata.gz: 2095589abcc04156fe68eeec93c81c9671e7c02b8fd85f1c9ade4dd8cc9d818099b002512b861107120f1d9a4dbd183d7fe9ec111c37b5241370a8558e893fb3
7
+ data.tar.gz: cd349b95b628d59181a6a7131b96dee9c7c385207ffc1c06e4c092eeae354e0674f52eda397cccd387b0f5a13f04e5fcfd250c5d23bc2b1ba9db80015bdaf03d
@@ -3,6 +3,20 @@ require "standard_exceptions/version"
3
3
  module StandardExceptions
4
4
 
5
5
  module ExceptionInterface
6
+
7
+ def self.included(aClass)
8
+ aClass.send :extend, ClassMethods
9
+ end
10
+
11
+ module ClassMethods
12
+ # eg. 'Not Found'
13
+ def human_name(e_class=self)
14
+ i = e_class.name.rindex('::')
15
+ base_name = e_class.name[(i+2)..-1]
16
+ base_name.split(/(?=[A-Z])/).join(' ')
17
+ end
18
+ end
19
+
6
20
  attr_accessor :status
7
21
 
8
22
  attr_writer :inner
@@ -10,13 +24,6 @@ module StandardExceptions
10
24
  @inner || self.cause
11
25
  end
12
26
 
13
- # eg. 'Not Found'
14
- def self.human_name(e_class=self)
15
- i = e_class.name.rindex('::')
16
- base_name = e_class.name[(i+2)..-1]
17
- base_name.split(/(?=[A-Z])/).join(' ')
18
- end
19
-
20
27
  def human_name
21
28
  self.class.human_name
22
29
  end
@@ -1,3 +1,3 @@
1
1
  module StandardExceptions
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard_exceptions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary McGhee
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-30 00:00:00.000000000 Z
11
+ date: 2017-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler