Class: Soaspec::TestServer::IdManager
- Inherits:
-
Object
- Object
- Soaspec::TestServer::IdManager
- Defined in:
- lib/soaspec/test_server/id_manager.rb
Overview
Handles returning ids dependent on a number of factors Made to demonstrate creating testing a list of ids
Class Attribute Summary collapse
-
.developed ⇒ Object
Returns the value of attribute developed.
Class Method Summary collapse
-
.result_for(num, id) ⇒ Object
Result depending on num, id and whether ‘@developed’ is set.
-
.undeveloped_id(num, id) ⇒ String
True of false depending on num and id.
Class Attribute Details
.developed ⇒ Object
Returns the value of attribute developed.
9 10 11 |
# File 'lib/soaspec/test_server/id_manager.rb', line 9 def developed @developed end |
Class Method Details
.result_for(num, id) ⇒ Object
Returns Result depending on num, id and whether ‘@developed’ is set.
12 13 14 15 |
# File 'lib/soaspec/test_server/id_manager.rb', line 12 def result_for(num, id) result = undeveloped_id(num, id) unless @developed result || 'true' end |
.undeveloped_id(num, id) ⇒ String
Returns true of false depending on num and id.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/soaspec/test_server/id_manager.rb', line 18 def undeveloped_id(num, id) case num when '1', '4', '10' then 'false' if id == '40' when '3', '11', '9' then 'false' if id == '74' when '8', '6', '8' then 'false' if id == '80' when '7', '5', '12' then 'false' if id == '64' else 'true' end end |