simple_ams 0.2.0 → 0.2.1

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: 9b09157cf3099fe306077aeac488a0f2d4a9674f554d98b7ad1e73772b2beffb
4
- data.tar.gz: 5134001b312f8602fb2bee3712f81ba9e859e247cacef59d1e4abeb8e15d66de
3
+ metadata.gz: 0e9a6bbc4ee5adfd199a3a3aa79ae6609e578e600e4ca1f93888efb2263f9b39
4
+ data.tar.gz: 3d25a70ad671b9ca9b57e229070dcb029d5368bc7f503335628fe761ee325a30
5
5
  SHA512:
6
- metadata.gz: 993d7b6f1ad749b2b992885e4f13d606f237895df3858261431c1b3369f281782e6d26e4cc690dd4af032dd54a9f903e006a7c10f12b3d04496fdfd5beefce97
7
- data.tar.gz: 8abc4dab396f0d31955c9a19290525cf50b46c583feefc812833fd2d1f946461c99f7b41ef47fe907e7d2ea11d44dd78e057040628a7a7ca2d97d59b09d02b45
6
+ metadata.gz: 49f94ebf51efda1776abda3e7db9aa8a6a75b1ad25fe566a43a862e4bf4af6efc77c3d777138ba62c410d4be30ad5293eab0edf7eaf8729b775faff3ef0a1b84
7
+ data.tar.gz: 2a287e0f5d6b368f509a95f10777ff8e41bf57bcde11588ede23a0132d4fc1d8b4493c8aebb7e1292ac6ccd179bb737fd9c10c59ba78240ce68112a6887fdf20
@@ -47,12 +47,12 @@ class SimpleAMS::Adapters::JSONAPI
47
47
 
48
48
  def transform_key(key)
49
49
  case options[:key_transform]
50
- #when :camel
51
- #when :camel_lower
52
- when :dash
50
+ when :camel
51
+ key.to_s.split('_').map(&capitalize).join
52
+ when :kebab
53
53
  key.to_s.gsub('_','-')
54
- when :underscore
55
- key.to_s.gsub('-', '_')
54
+ when :snake
55
+ key
56
56
  else
57
57
  key
58
58
  end
@@ -83,7 +83,7 @@ class SimpleAMS::Adapters::JSONAPI
83
83
  return {} if relation.embedded.generics[:skip_data]&.value
84
84
 
85
85
  if relation.folder?
86
- value = relation.documents.map{|doc|
86
+ value = relation.each.map{|doc|
87
87
  {
88
88
  doc.primary_id.name => doc.primary_id.value.to_s,
89
89
  type: doc.type.name
@@ -103,10 +103,7 @@ class SimpleAMS::Document
103
103
 
104
104
  #do we really need this method ?
105
105
  def documents
106
- @members.map do |resource|
107
- #need optimization here!
108
- SimpleAMS::Document.new(options_for(resource))
109
- end
106
+ each.map
110
107
  end
111
108
 
112
109
  def resource_options
@@ -28,7 +28,6 @@ module SimpleAMS::DSL
28
28
  module ClassMethods
29
29
  #TODO: Shouldn't we call here super to presever user's behavior ?
30
30
  def inherited(subclass)
31
- #TODO: why this breaks collection type?
32
31
  subclass.with_options(
33
32
  options.merge(
34
33
  #TODO: maybe add another group of elements under dsl?
@@ -1,3 +1,3 @@
1
1
  module SimpleAMS
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_development_dependency "bundler", "~> 1.15"
23
+ spec.add_development_dependency "bundler", "~> 2.0.2"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
25
  spec.add_development_dependency "rspec", "~> 3.0"
26
26
  spec.add_development_dependency "faker", "~> 1.8.5"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_ams
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filippos Vasilakis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-25 00:00:00.000000000 Z
11
+ date: 2019-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.15'
19
+ version: 2.0.2
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.15'
26
+ version: 2.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
- rubygems_version: 3.0.2
162
+ rubygems_version: 3.0.3
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: ActiveModel Serializers, simplified.