flight_facade 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/flight_facade.gemspec +1 -0
- data/lib/flight_facade/models.rb +16 -0
- data/lib/flight_facade/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9165c90584d144106fee47218783ff74cd0d19903c904f90f9684e03fa727e1b
|
4
|
+
data.tar.gz: 9b8ab9bd4b6f678f468ec5160c8f2cb76cbb56b6317a460ea8383cd17eb51699
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07f6332dc999292084a14909138ba713917a9be51311fd895d0b0955cb85a9ff92f1683c528d6b655ffe2f371cefc4bccbb3c55d264df79c3fb54b88e05e04dc
|
7
|
+
data.tar.gz: 204d5e75fc8c882eb9e9e24f95022eeeefa84fba173fb6e811e602fc87e092ef94cc6f06afd479dbf842daaf89acdcc8e19b4d0bcee4f60b59ff16493358ba38
|
data/flight_facade.gemspec
CHANGED
@@ -50,6 +50,7 @@ Gem::Specification.new do |spec|
|
|
50
50
|
spec.add_runtime_dependency "activesupport"
|
51
51
|
spec.add_runtime_dependency 'activemodel'
|
52
52
|
spec.add_runtime_dependency "hashie"
|
53
|
+
spec.add_runtime_dependency 'jsonapi-serializers', '~> 1.0'
|
53
54
|
|
54
55
|
spec.add_development_dependency "bundler", "~> 2.0"
|
55
56
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/flight_facade/models.rb
CHANGED
@@ -44,11 +44,27 @@ module FlightFacade
|
|
44
44
|
klass.delegate(*(ActiveModel::Validations.instance_methods - Object.methods), to: :data)
|
45
45
|
end
|
46
46
|
|
47
|
+
def self._jsonapi_serializer_class_name
|
48
|
+
@_jsonapi_serializer_class_name ||= name.split('::').last + 'Serializer'
|
49
|
+
end
|
50
|
+
|
51
|
+
def self._type
|
52
|
+
@_type ||= name.split('::').last.demodulize.tableize.dasherize
|
53
|
+
end
|
54
|
+
|
47
55
|
attr_reader :data
|
48
56
|
|
49
57
|
def initialize(*a)
|
50
58
|
@data = self.class::DataHash.new(*a)
|
51
59
|
end
|
60
|
+
|
61
|
+
def jsonapi_serializer_class_name
|
62
|
+
self.class._jsonapi_serializer_class_name
|
63
|
+
end
|
64
|
+
|
65
|
+
def type
|
66
|
+
self.class._type
|
67
|
+
end
|
52
68
|
end
|
53
69
|
|
54
70
|
class Node < BaseHashieDashModel
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flight_facade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alces Flight Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: jsonapi-serializers
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: bundler
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|