Essa gem tem como objetivo automatizar a integração com a Rest API da Edools.
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
Adicione o token (credencial) administrativa:
Edools.settings.token = 'TOKEN_ADM'
O retorno será:
{ credentials: 'SCHOOL_TOKEN', school_id: SCHOOL_ID }
Para carregar a escola:
Edools.settings.token = 'SCHOOL_TOKEN'
Edools.settings.school_id = SCHOOL_ID
school = Edools.schools.get
school.data['terms_of_use'] = 'new_terms_of_use'
school.update
school.courses.create('title')
school.courses.all
school.products.create('name')
school.products.all
school.students.create('first_name', '[email protected]', 'password')
school.students.all
product = school.products.find(PRODUCT_ID)
product.students.all
Edools.settings.subdomain = 'SUBDOMAIN'
Edools.settings.school_id = SCHOOL_ID
session_data = Edools.sessions.create(EMAIL, PASSWORD)
Edools.settings.token = session_data['credentials']
media = Edools.media.get(MEDIA_ID)
s3_file_url = media['s3_file_url']
loader = Edools.loader.csv(CSV_PATH)
loader.start
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.
Bug reports and pull requests are welcome on GitHub at https://github.com/vmlellis/edools.
The gem is available as open source under the terms of the MIT License.