coaster 1.0.4 → 1.0.5

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
  SHA256:
3
- metadata.gz: 1efdff11e3158914f521590fb64642e9c1834987317b896db24896c31e772bcf
4
- data.tar.gz: 3fcdb6480424ddcc27cc50c0568e6b8d9967bf494f8118d174d82e9072c03974
3
+ metadata.gz: 71910814edd2fcc1011e2f7bbc0d5003d3ffacca49d8a60f4869859d7c911afd
4
+ data.tar.gz: 5898b403bcb2263ff96c70721f724b5f91d9e52dff474f90a9ea854effba5676
5
5
  SHA512:
6
- metadata.gz: 270b1faeeae2fe9fcccd3e0f2c4d9d8234c7d0288ee949ea29b7faac70e711e5394b2cb06b14da11a6e71fe770c46416e9e8e10fadca2303470171986e6a3911
7
- data.tar.gz: c895e44a856beae32d2b46f09547d5c69aba008a46581ee096f9b069e6909251574f6dccf62f899fa3e51771e48acc1ad601f0a46e07a87cb5c8e59b706ea1f4
6
+ metadata.gz: dd1a8ee8e2f472633ef7ea34588cde48d77cb053ad186aac02702c806afbb4dd8829ece4892e456413ca6c840afa77d637f9fa2e068922319b4a4bd850ded75e
7
+ data.tar.gz: 8996da8e600df0d704353b89daba9f2c97b4261e4b77c7be32aa32644cb8c8018ef8b4f323de6186f5e6deeabe44f304ca0979a4c1b96abf714300487e0d11db
@@ -4,14 +4,11 @@ class StandardError
4
4
  cattr_accessor :cleaner, :cause_cleaner
5
5
 
6
6
  class << self
7
- def status
8
- 999999 # Unknown
9
- end
7
+ def status; 999999 end # Unknown
10
8
  alias_method :code, :status
11
-
12
- def http_status
13
- 500
14
- end
9
+ def http_status; 500 end
10
+ def report?; true end
11
+ def intentional?; false end
15
12
 
16
13
  def title
17
14
  t = _translate('.title')
@@ -66,17 +63,9 @@ class StandardError
66
63
  super(msg)
67
64
  end
68
65
 
69
- def safe_message
70
- message || ''
71
- end
72
-
73
- def status
74
- self.class.status
75
- end
76
-
77
- def title
78
- attributes[:title] || self.class.title
79
- end
66
+ def safe_message; message || '' end
67
+ def status; self.class.status end
68
+ def root_cause; cause.respond_to?(:root_cause) ? cause.root_cause : self end
80
69
 
81
70
  def attributes
82
71
  return @attributes if defined?(@attributes)
@@ -88,29 +77,15 @@ class StandardError
88
77
  end
89
78
  alias_method :attr, :attributes
90
79
 
91
- def http_status
92
- attributes[:http_status] || self.class.http_status
93
- end
94
-
95
- def http_status=(value)
96
- attributes[:http_status] = value
97
- end
98
-
99
- def report?
100
- attributes.key?(:report) ? attributes[:report] : true
101
- end
102
-
103
- def intentional?
104
- attributes[:intentional]
105
- end
106
-
107
- def code
108
- attributes[:code] || status
109
- end
110
-
111
- def code=(value)
112
- attributes[:code] = value
113
- end
80
+ def http_status; attributes[:http_status] || self.class.http_status end
81
+ def http_status=(value); attributes[:http_status] = value end
82
+ def code; attributes[:code] || status end
83
+ def code=(value); attributes[:code] = value end
84
+ def title; attributes[:title] || self.class.title end
85
+ def report?; attributes.key?(:report) ? attributes[:report] : self.class.report? end
86
+ def intentional?; attributes.key?(:intentional) ? attributes[:intentional] : self.class.intentional? end
87
+ def object; attributes[:object] || attributes[:obj] end
88
+ alias_method :obj, :object
114
89
 
115
90
  # description is user friendly messages, do not use error's message
116
91
  # error message is not user friendly in many cases.
@@ -130,15 +105,6 @@ class StandardError
130
105
  attributes[:descriptions]
131
106
  end
132
107
 
133
- def object
134
- attributes[:object] || attributes[:obj]
135
- end
136
- alias_method :obj, :object
137
-
138
- def root_cause
139
- cause.respond_to?(:root_cause) ? cause.root_cause : self
140
- end
141
-
142
108
  def to_hash
143
109
  hash = attributes.merge(
144
110
  type: self.class.name, status: status,
@@ -1,3 +1,3 @@
1
1
  module Coaster
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - buzz jung