Sha256: 28da809c0eac2526dbfb3da1d3db8e0e15841f80172975debf5362c5cd22a127

Contents?: true

Size: 900 Bytes

Versions: 21

Compression:

Stored size: 900 Bytes

Contents

module Soaspec
  module TestServer
    # Handles returning ids dependent on a number of factors
    # Made to demonstrate creating testing a list of ids
    class IdManager
      @developed = false
      class << self

        attr_accessor :developed

        # @return  Result depending on num, id and whether '@developed' is set
        def result_for(num, id)
          result = undeveloped_id(num, id) unless @developed
          result || 'true'
        end

        # @return [String] true of false depending on num and id
        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

      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
soaspec-0.2.8 lib/soaspec/test_server/id_manager.rb
soaspec-0.2.7 lib/soaspec/test_server/id_manager.rb
soaspec-0.2.5 lib/soaspec/test_server/id_manager.rb
soaspec-0.2.4 lib/soaspec/test_server/id_manager.rb
soaspec-0.2.3 lib/soaspec/test_server/id_manager.rb
soaspec-0.2.2 lib/soaspec/test_server/id_manager.rb
soaspec-0.2.1 lib/soaspec/test_server/id_manager.rb
soaspec-0.2.0 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.18 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.17 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.16 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.15 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.14 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.13 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.12 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.11 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.10 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.9 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.8 lib/soaspec/test_server/id_manager.rb
soaspec-0.1.7 lib/soaspec/test_server/id_manager.rb