class Dacom::Response
Constants
- SUCCESS_CODE
Attributes
code[R]
message[R]
raw[R]
Public Class Methods
new(data = {})
click to toggle source
# File lib/dacom/response.rb, line 7 def initialize(data = {}) @code = data.fetch("LGD_RESPCODE") { data[:code] } @message = data.fetch("LGD_RESPMSG") { data[:message] } @raw = data.fetch("LGD_RESPONSE") { [] } end
Public Instance Methods
data()
click to toggle source
# File lib/dacom/response.rb, line 13 def data @raw.first end
successful?()
click to toggle source
# File lib/dacom/response.rb, line 17 def successful? @code == SUCCESS_CODE end
to_s()
click to toggle source
# File lib/dacom/response.rb, line 21 def to_s %Q{<Dacom::Response:#{__id__}, code: "#{@code}", message: "#{@message}", successful: #{successful?}>} end