Class: Apiary::Okapi::ValidationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/okapi/resources.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#body_diffObject

Returns the value of attribute body_diff.



33
34
35
# File 'lib/okapi/resources.rb', line 33

def body_diff
  @body_diff
end

#body_passObject

Returns the value of attribute body_pass.



33
34
35
# File 'lib/okapi/resources.rb', line 33

def body_pass
  @body_pass
end

#errorObject

Returns the value of attribute error.



33
34
35
# File 'lib/okapi/resources.rb', line 33

def error
  @error
end

#header_diffObject

Returns the value of attribute header_diff.



33
34
35
# File 'lib/okapi/resources.rb', line 33

def header_diff
  @header_diff
end

#header_passObject

Returns the value of attribute header_pass.



33
34
35
# File 'lib/okapi/resources.rb', line 33

def header_pass
  @header_pass
end

#schema_resObject

Returns the value of attribute schema_res.



33
34
35
# File 'lib/okapi/resources.rb', line 33

def schema_res
  @schema_res
end

#statusObject

Returns the value of attribute status.



33
34
35
# File 'lib/okapi/resources.rb', line 33

def status
  @status
end

Instance Method Details

#get_statusObject



39
40
41
42
# File 'lib/okapi/resources.rb', line 39

def get_status
  return true if not @error and @header_pass and ((schema and  schema_pass) or (not schema and @body_pass))
  return false
end

#schemaObject



44
45
46
# File 'lib/okapi/resources.rb', line 44

def schema
  !(@schema_res == false)
end

#schema_passObject



48
49
50
# File 'lib/okapi/resources.rb', line 48

def schema_pass
  not schema or schema and @schema_res and not @schema_res['errors']
end