Class: Sambal::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/sambal/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, success) ⇒ Response


6
7
8
9
10
11
12
13
14
15
# File 'lib/sambal/response.rb', line 6

def initialize(message, success)
  msg = message.split("\n")
  msg.each do |line|
    if line =~ /^NT\_.*\s/
      @message = line
    end
  end
  @message ||= message
  @success = success
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message


4
5
6
# File 'lib/sambal/response.rb', line 4

def message
  @message
end

Instance Method Details

#failure?Boolean


21
22
23
# File 'lib/sambal/response.rb', line 21

def failure?
  !success?
end

#success?Boolean


17
18
19
# File 'lib/sambal/response.rb', line 17

def success?
  @success
end