FedenaSdk
Ruby wrapper for fedena api
Installation
Add this line to your application's Gemfile:
gem 'fedena_sdk'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fedena_sdk
Usage
Initialize sdk
client = FedenaSdk.authenticate(
client_id: "",
client_secret: "",
uri: '',
redirect_uri: "");
Generate access token
Using username and password
FedenaSdk.access_token_from_password('username','password','redirect_uri');
Using authcode
- Get authorise url
ruby client.auth_code.authorize_url(:redirect_uri => '')
Get auth code from url
Generate token
token = client.auth_code.get_token(auth_code,{:redirect_uri => ''},:header_format=>"Token token=\"%s\"")
News
- Get all News
FedenaSdk::News.all
User
- Get user details
FedenaSdk::User.find('username')
School
- Get current school details
FedenaSdk::School.current_school
Attendance
- Get attendance status of a student
FedenaSdk::Attendance.show(admission_no,date=>'10-12-2014')
- Search in attendance entries
FedenaSdk::Attendance.search(query)
- Marking attendance
attendance = FedenaSdk::Attendance.new(student_admission_no: "", forenoon: "", afternoon: "", date: "", batch_name: "", reason: "")
attendance.save
- Deleting attendance object
attendance.destroy
- Deleting attendance entry by admission_no and date
FedenaSdk::Attendance.destroy(admission_no,date)
Course
- Get all courses
FedenaSdk::Course.all
Batch
- Search for batches
FedenaSdk::Batch.search(query)
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/tachyons/fedena-sdk-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.