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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc3fa2547f7b6f265ad3f3f769b8f528e69025af7c08669de23eebc0cc7b61cd
4
- data.tar.gz: 3a1b3121c6a2238ebda372dfce3071b3ff5a7d970906ee99fcdedfe4f0fd9be9
3
+ metadata.gz: 9165c90584d144106fee47218783ff74cd0d19903c904f90f9684e03fa727e1b
4
+ data.tar.gz: 9b8ab9bd4b6f678f468ec5160c8f2cb76cbb56b6317a460ea8383cd17eb51699
5
5
  SHA512:
6
- metadata.gz: 8db9b40b33a8ef459382750e4028510a2e24d49eb20a8a7a8a5d0df7ce817d20da3bbb471a481cca0ba15b1f69f09de0b5fccacac21d139d758886b9ef9f0c67
7
- data.tar.gz: eda411761a345b59c33a93971d803b30dfb06c19be67611737081c718518a223ceea5fa1617c3a150a0ed146659793cd92bd3a84fd10cc2f7adee3c7bb03a40a
6
+ metadata.gz: 07f6332dc999292084a14909138ba713917a9be51311fd895d0b0955cb85a9ff92f1683c528d6b655ffe2f371cefc4bccbb3c55d264df79c3fb54b88e05e04dc
7
+ data.tar.gz: 204d5e75fc8c882eb9e9e24f95022eeeefa84fba173fb6e811e602fc87e092ef94cc6f06afd479dbf842daaf89acdcc8e19b4d0bcee4f60b59ff16493358ba38
@@ -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"
@@ -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
@@ -26,5 +26,5 @@
26
26
  #===============================================================================
27
27
 
28
28
  module FlightFacade
29
- VERSION = "0.1.3"
29
+ VERSION = "0.1.5"
30
30
  end
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.3
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-17 00:00:00.000000000 Z
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