Class: Collmex::Api::Message
- Inherits:
-
Line
- Object
- Line
- Collmex::Api::Message
show all
- Defined in:
- lib/collmex/api.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Line
default_hash, hashify, #initialize, #to_a, #to_csv, #to_h, #to_stringified_array
Class Method Details
.specification ⇒ Object
249
250
251
252
253
254
255
256
257
|
# File 'lib/collmex/api.rb', line 249
def self.specification
[
{ name: :identifyer , type: :string , fix: "MESSAGE" },
{ name: :type , type: :string },
{ name: :id , type: :integer },
{ name: :text , type: :string },
{ name: :line , type: :integer },
]
end
|
Instance Method Details
#result ⇒ Object
268
269
270
271
272
273
274
275
276
277
278
279
|
# File 'lib/collmex/api.rb', line 268
def result
if @hash.has_key?(:type) && !@hash[:type].empty?
case @hash[:type]
when "S" then :success
when "W" then :warning
when "E" then :error
else :undefined
end
else
:undefined
end
end
|
#success? ⇒ Boolean
260
261
262
263
264
265
266
|
# File 'lib/collmex/api.rb', line 260
def success?
if @hash.has_key?(:type) && !@hash[:type].empty? && @hash[:type] == "S"
true
else
false
end
end
|