Ruby wrapper for fedena api
Add this line to your application's Gemfile:
gem 'fedena_sdk'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fedena_sdk
Initialize sdk
client = FedenaSdk.authenticate do |config|
config.client_id = "<client_id>"
config.client_secret = "<client_secret>"
config.uri = '<fedena_instance_uri>'
config.redirect_uri = "<app_redirect_uri>"
end
FedenaSdk.access_token_from_password('username','password','redirect_uri');
- Get authorise url
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\"")
- Get all News
FedenaSdk::News.all
- Get user details
FedenaSdk::User.find('username')
- Get current school details
FedenaSdk::School.current_school
- 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)
- Editing an attendance entry
attendance.update_attributes(reason: "new reason")
- Get all courses
FedenaSdk::Course.all
- Search for batches
FedenaSdk::Batch.search(query)
- Search for students
FedenaSdk::Student.search(admission_no_like: "123")
- Find student by admission_no
FedenaSdk::Student.find(<admission_no>)
- Set profile photo for a student
FedenaSdk::Student.new.upload_photo("<admission_no>",photo)
- Get biometric information
FedenaSdk::BiometricInformation.find(<biometric_id>)
- Search for employees
FedenaSdk::Employee.search("<query>")
- Get all employee departments
FedenaSdk::EmployeeDepartment.all
- Get all leave types
FedenaSdk::EmployeeLeaveType.all
- Get all employe postions
FedenaSdk::EmployeePosition.all
- Search for exam groups
FedenaSdk::ExamGroup.search("<query>")
- Search for finance transaction
FedenaSdk::FinanceTransaction.search("<query>")
- Get all student categories
FedenaSdk::StudentCategory.all
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/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.
The gem is available as open source under the terms of the MIT License.