Class: Icalia::DeserializableResource
- Inherits:
-
JSONAPI::Deserializable::Resource
- Object
- JSONAPI::Deserializable::Resource
- Icalia::DeserializableResource
show all
- Defined in:
- lib/icalia/serialization/deserializable_resource.rb
Direct Known Subclasses
DeserializableCheckRun, DeserializableCloudIdentity, DeserializableCodeCheckRunEvent, DeserializableCodeCommit, DeserializableCodeIssue, DeserializableCodeIssueOccurrence, DeserializableCodeMergeRequest, DeserializableCodeMergeRequestEvent, DeserializableCodeRepository, DeserializableCodeRepositoryEvent, DeserializableCodeRepositoryReference, DeserializableEmailAccount, DeserializableMembership, DeserializableMembershipEvent, DeserializableOAuthAccessToken, DeserializableOauthAccessTokenEvent, DeserializableOauthApplication, DeserializableOrganization, DeserializableOrganizationEvent, DeserializablePerson, DeserializableUser
Class Method Summary
collapse
Class Method Details
.classify_data(data) ⇒ Object
20
21
22
|
# File 'lib/icalia/serialization/deserializable_resource.rb', line 20
def classify_data(data)
classify_type data['type']
end
|
.classify_type(type) ⇒ Object
16
17
18
|
# File 'lib/icalia/serialization/deserializable_resource.rb', line 16
def classify_type(type)
type.underscore.camelize
end
|
.get_stand_in(id:, type:) ⇒ Object
24
25
26
|
# File 'lib/icalia/serialization/deserializable_resource.rb', line 24
def get_stand_in(id:, type:)
Icalia::ModelProxy.new id: id, type: type
end
|
.get_stand_ins(rel) ⇒ Object
28
29
30
31
32
33
34
35
36
|
# File 'lib/icalia/serialization/deserializable_resource.rb', line 28
def get_stand_ins(rel)
if rel['data'].nil?
Icalia::ModelCollectionProxy.new rel['links']
else
rel['data'].map do |data|
get_stand_in id: data['id'], type: classify_data(data)
end
end
end
|