Sha256: 7531b74a857b65b2b366a50c9d4a51b7c76c3e2845cb1ee4056de96f3a753ef9

Contents?: true

Size: 947 Bytes

Versions: 7

Compression:

Stored size: 947 Bytes

Contents

module RubyIsds
  class Configuration
    attr_writer :data_box, :username, :password, :env, :api_url

    def initialize
      @username = nil
      @password = nil
      @data_box = nil
      @env = nil
    end

    def data_box
      raise ConfigNotSet, 'data_box' unless @data_box
      @data_box
    end

    def username
      raise ConfigNotSet, 'username' unless @username
      @username
    end

    def password
      raise ConfigNotSet, 'password' unless @password
      @password
    end

    ##
    # env values:
    #   :development (default)
    #   :production
    #
    def env
      return :development unless @env
      @env
    end

    def api_domain
      case @env
      when :production then 'https://ws1c.mojedatovaschranka.cz'
      else 'https://ws1.czebox.cz'
      end
    end

    def xml_url
      case @env
      when :production then 'mojedatovaschranka.cz'
      else 'czechpoint.cz'
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby_isds-0.10.5 lib/ruby_isds/configuration.rb
ruby_isds-0.10.4 lib/ruby_isds/configuration.rb
ruby_isds-0.10.3 lib/ruby_isds/configuration.rb
ruby_isds-0.10.2 lib/ruby_isds/configuration.rb
ruby_isds-0.10.1 lib/ruby_isds/configuration.rb
ruby_isds-0.9.1 lib/ruby_isds/configuration.rb
ruby_isds-0.9.0 lib/ruby_isds/configuration.rb