Sha256: b1316466033cc4446cebb468c12d1c4fe5ee067891786d878158e5e838349a92

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

module RandomOrgHttpApi
  module Configuration
    DOMAIN = 'https://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

1 entries across 1 versions & 1 rubygems

Version Path
random_org_http_api-0.0.3.1 lib/random_org_http_api/configuration.rb