Class: Pandarus::ModelBase

Inherits:
Object
  • Object
show all
Defined in:
lib/pandarus/model_base.rb

Direct Known Subclasses

Account, AccountNotification, Admin, Answer, Assignment, AssignmentDate, AssignmentGroup, AssignmentOverride, AuthenticationProvider, Avatar, BlueprintMigration, BlueprintTemplate, Bookmark, CalendarEvent, CalendarLink, ChangeRecord, Collaboration, Collaborator, ColumnDatum, CommMessage, CommunicationChannel, CompletionRequirement, Conference, ConferenceRecording, ContentDetails, ContentExport, ContentMigration, Conversation, ConversationParticipant, Course, CourseEpubExport, CourseEvent, CourseEventLink, CourseNickname, CourseProgress, CustomColumn, Day, DiscussionTopic, Enrollment, EnrollmentTerm, EpubExport, ExternalFeed, ExternalToolTagAttributes, Favorite, Feature, FeatureFlag, FederatedAttributesConfig, File, FileAttachment, Folder, Grade, GradeChangeEvent, GradeChangeEventLinks, Grader, GradingRules, GradingSchemeEntry, GradingStandard, Group, GroupCategory, GroupMembership, JWT, License, LockInfo, LtiAssignment, MediaComment, MigrationIssue, Migrator, Module, ModuleItem, ModuleItemSequence, NeedsGradingCount, NotificationPreference, OriginalityReport, Outcome, OutcomeGroup, OutcomeLink, Page, PageRevision, PageView, PageViewLinks, PeerReview, PlannerNote, PlannerOverride, Profile, Progress, ProvisionalGrade, Quiz, QuizAssignmentOverride, QuizAssignmentOverrideSet, QuizAssignmentOverrideSetContainer, QuizGroup, QuizPermissions, QuizQuestion, QuizReport, QuizSubmissionQuestion, Report, ReportParameters, Role, Rubric, RubricAssessment, RubricCriteria, RubricRating, SSOSettings, Section, SharedBrandConfig, SisImport, SisImportCounts, SisImportData, Submission, SubmissionComment, SubmissionHistory, SubmissionVersion, Tab, Term, ToolSetting, TurnitinSettings, UsageRights, User

Constant Summary collapse

BUILTIN_TYPES =
%w(
  Float
  Integer
  String
  Date
  DateTime
  Hash
)

Class Method Summary collapse

Class Method Details

.resolve_type(type_name, opts = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/pandarus/model_base.rb', line 16

def self.resolve_type(type_name, opts = {})
  qualified_type = BUILTIN_TYPES.include?(type_name) ? type_name : "Pandarus::#{type_name}"
  if ["Map", "Array", nil].include?(type_name)
    return "String"
  elsif type_name == "Object"
    return "Hash"
  elsif opts[:collection]
    return Array[qualified_type]
  else
    return qualified_type
  end
end