Giter Site home page Giter Site logo

edools's Introduction

Edools

Build Status Coverage Status

Essa gem tem como objetivo automatizar a integração com a Rest API da Edools.

Instalação

Adicione a linha abaixo no arquivo Gemfile da sua aplicação:

gem 'edools', git: 'https://github.com/vmlellis/edools'

E então execute:

$ bundle

Ou instale manualmente:

$ gem install edools

Utilização

Primeira configuração - Criar a escola

Adicione o token (credencial) administrativa:

Edools.settings.token = 'TOKEN_ADM'

O retorno será:

{ credentials: 'SCHOOL_TOKEN', school_id: SCHOOL_ID }

Carregando a escola

Para carregar a escola:

Edools.settings.token = 'SCHOOL_TOKEN'
Edools.settings.school_id = SCHOOL_ID
school = Edools.schools.get

Atualizar atributos da escola

school.data['terms_of_use'] = 'new_terms_of_use'
school.update

Criar novo curso

school.courses.create('title')

Listar cursos

school.courses.all

Criar novo produto da escola

school.products.create('name')

Listar produtos da escola

school.products.all

Criar aluno

school.students.create('first_name', '[email protected]', 'password')

Listar todos alunos de uma escola

school.students.all

Listar todos alunos de um produto

product = school.products.find(PRODUCT_ID)
product.students.all

Parte 2

Criar sessão

Edools.settings.subdomain = 'SUBDOMAIN'
Edools.settings.school_id = SCHOOL_ID
session_data = Edools.sessions.create(EMAIL, PASSWORD)

Edools.settings.token = session_data['credentials']

Carregar url de uma mídia

media = Edools.media.get(MEDIA_ID)
s3_file_url = media['s3_file_url']

Importar CSV

loader = Edools.loader.csv(CSV_PATH)
loader.start

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/vmlellis/edools.

License

The gem is available as open source under the terms of the MIT License.

edools's People

Contributors

vmlellis avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.