Class: GfreshPoint::RequestObjects::RequestObject

Inherits:
Object
  • Object
show all
Defined in:
lib/gfresh_point/request_objects/request_object.rb

Instance Method Summary collapse

Instance Method Details

#add_error(param, message) ⇒ Object



4
5
6
# File 'lib/gfresh_point/request_objects/request_object.rb', line 4

def add_error(param, message)
  errors << {'param': param, message: message}
end

#errorsObject



16
17
18
# File 'lib/gfresh_point/request_objects/request_object.rb', line 16

def errors
  @errors ||= []
end

#has_errorsObject



8
9
10
# File 'lib/gfresh_point/request_objects/request_object.rb', line 8

def has_errors
  errors.count > 0
end

#success?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/gfresh_point/request_objects/request_object.rb', line 12

def success?
  !has_errors
end