Class: Fission::Response

Inherits:
Object show all
Defined in:
lib/fission.old/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Response


5
6
7
8
9
# File 'lib/fission.old/response.rb', line 5

def initialize(args={})
  @code = args.fetch :code, 1
  @output = args.fetch :output, ''
  @data = args.fetch :data, nil
end

Instance Attribute Details

#codeObject

Returns the value of attribute code


3
4
5
# File 'lib/fission.old/response.rb', line 3

def code
  @code
end

#dataObject

Returns the value of attribute data


3
4
5
# File 'lib/fission.old/response.rb', line 3

def data
  @data
end

#outputObject

Returns the value of attribute output


3
4
5
# File 'lib/fission.old/response.rb', line 3

def output
  @output
end

Instance Method Details

#successful?Boolean


11
12
13
# File 'lib/fission.old/response.rb', line 11

def successful?
  @code == 0
end