lib/meibo/role.rb in meibo-0.16.0 vs lib/meibo/role.rb in meibo-0.17.0
- old
+ new
@@ -1,55 +1,56 @@
# frozen_string_literal: true
module Meibo
class Role
TYPES = {
- primary: 'primary',
- secondary: 'secondary'
+ primary: "primary",
+ secondary: "secondary"
}.freeze
ROLES = {
- aide: 'aide',
- counselor: 'counselor',
- district_administrator: 'districtAdministrator',
- guardian: 'guardian',
- parent: 'parent',
- principal: 'principal',
- proctor: 'proctor',
- relative: 'relative',
- site_administrator: 'siteAdministrator',
- student: 'student',
- system_administrator: 'systemAdministrator',
- teacher: 'teacher'
+ aide: "aide",
+ counselor: "counselor",
+ district_administrator: "districtAdministrator",
+ guardian: "guardian",
+ parent: "parent",
+ principal: "principal",
+ proctor: "proctor",
+ relative: "relative",
+ site_administrator: "siteAdministrator",
+ student: "student",
+ system_administrator: "systemAdministrator",
+ teacher: "teacher"
}.freeze
DataModel.define(
self,
attribute_name_to_header_field_map: {
- sourced_id: 'sourcedId',
- status: 'status',
- date_last_modified: 'dateLastModified',
- user_sourced_id: 'userSourcedId',
- role_type: 'roleType',
- role: 'role',
- begin_date: 'beginDate',
- end_date: 'endDate',
- org_sourced_id: 'orgSourcedId',
- user_profile_sourced_id: 'userProfileSourcedId'
+ sourced_id: "sourcedId",
+ status: "status",
+ date_last_modified: "dateLastModified",
+ user_sourced_id: "userSourcedId",
+ role_type: "roleType",
+ role: "role",
+ begin_date: "beginDate",
+ end_date: "endDate",
+ org_sourced_id: "orgSourcedId",
+ user_profile_sourced_id: "userProfileSourcedId"
}.freeze,
converters: {
- date: [:begin_date, :end_date].freeze,
+ date: %i[begin_date end_date].freeze,
datetime: [:date_last_modified].freeze,
- required: [:sourced_id, :user_sourced_id, :role_type, :role, :org_sourced_id].freeze,
+ required: %i[sourced_id user_sourced_id role_type role org_sourced_id].freeze,
enum: {
role: [*ROLES.values, ENUM_EXT_PATTERN].freeze,
role_type: TYPES.values.freeze
}.freeze,
status: [:status].freeze
}.freeze
)
- def initialize(sourced_id:, status: nil, date_last_modified: nil, user_sourced_id:, role_type:, role:, begin_date: nil, end_date: nil, org_sourced_id:, user_profile_sourced_id: nil, **extension_fields)
+ def initialize(sourced_id:, user_sourced_id:, role_type:, role:, org_sourced_id:, status: nil, date_last_modified: nil,
+ begin_date: nil, end_date: nil, user_profile_sourced_id: nil, **extension_fields)
@sourced_id = sourced_id
@status = status
@date_last_modified = date_last_modified
@user_sourced_id = user_sourced_id
@role_type = role_type