Sha256: fb9d59f28859c20493e7b9b1f88ceec88116992080f491f1833f1b6b270f8634
Contents?: true
Size: 1019 Bytes
Versions: 2
Compression:
Stored size: 1019 Bytes
Contents
module RandomOrgHttpApi module Configuration DOMAIN = 'www.random.org' DEFAULT_QUERY_PARAMS = { format: 'plain', base: '10', rnd: 'new', col: '1', min: '1', digits: 'on', loweralpha: 'on', upperalpha: 'on', unique: 'on' } # Query templates # Integer INTEGER_QUERY_KEYS = [:num, :min, :max, :col, :base, :format, :rnd] INTEGER_QUERY_TEMPLATE = "/integers/?num=%{num}&min=%{min}&max=%{max}&col=%{col}&base=%{base}&format=%{format}&rnd=%{rnd}" # String STRING_QUERY_KEYS = [:num, :len, :digits, :upperalpha, :loweralpha, :unique, :format, :rnd] STRING_QUERY_TEMPLATE = "/strings/?num=%{num}&len=%{len}&digits=%{digits}&upperalpha=%{upperalpha}&loweralpha=%{loweralpha}&unique=%{unique}&format=%{format}&rnd=%{rnd}" # Sequence SEQUENCE_QUERY_KEYS = [:min, :max, :col, :format, :rnd] SEQUENCE_QUERY_TEMPLATE = "/sequences/?min=%{min}&max=%{max}&col=%{col}&format=%{format}&rnd=%{rnd}" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
random_org_http_api-0.0.3 | lib/random_org_http_api/configuration.rb |
random_org_http_api-0.0.2 | lib/random_org_http_api/configuration.rb |