Class: Unitpost::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/unitpost/errors.rb

Overview

Every SDK method returns one of these; exactly one of data/error is set.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



24
25
26
# File 'lib/unitpost/errors.rb', line 24

def data
  @data
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



24
25
26
# File 'lib/unitpost/errors.rb', line 24

def error
  @error
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/unitpost/errors.rb', line 25

def success?
  error.nil?
end