Sha256: 1a22287975f18baab40720ba9585ea1b4052e6a2a811a5b25079c183da2c7732

Contents?: true

Size: 683 Bytes

Versions: 7

Compression:

Stored size: 683 Bytes

Contents

# frozen_string_literal: true

# Class encapsulating all available Sophia Routes
class SophiaRoutes
  def initialize(base_url:)
    @sophia_base_url = base_url
    return unless @sophia_base_url.nil?

    raise "The Sophia Base URL 'SOPHIA_URL' may be defined as an environment variable"
  end

  def students_route
    "#{@sophia_base_url}/Alunos"
  end

  def authentication_route
    "#{@sophia_base_url}/Autenticacao"
  end

  def classes_route
    "#{@sophia_base_url}/Turmas"
  end

  def courses_route
    "#{@sophia_base_url}/Cursos"
  end

  def collaborators_route
    "#{@sophia_base_url}/Colaboradores"
  end

  def sales_route
    "#{@sophia_base_url}/Vendas"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sophia_service-1.1.0 lib/sophia_service/sophia_routes.rb
sophia_service-1.0.0 lib/sophia_service/sophia_routes.rb
sophia_service-0.3.2 lib/sophia_service/sophia_routes.rb
sophia_service-0.3.1 lib/sophia_service/sophia_routes.rb
sophia_service-0.3.0 lib/sophia_service/sophia_routes.rb
sophia_service-0.2.0 lib/sophia_service/sophia_routes.rb
sophia_service-0.1.0 lib/sophia_service/sophia_routes.rb