quick_api 0.0.4 → 0.0.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
  SHA1:
3
- metadata.gz: 12ab662c2b179af0e3bc32a40f0ab3a19be646c3
4
- data.tar.gz: 9cb653e49c92329af552f11e59c7b02fe074a65e
3
+ metadata.gz: cc2ddbe6616c14dee21e36716a869e90b5620fc7
4
+ data.tar.gz: f0b6b4d65ed00d7f0000e60251fbbf030835c676
5
5
  SHA512:
6
- metadata.gz: 48ebfafaf9366fc9bb9f7f105b455131bb04c1506494dbb0a97390ba390c34c43950ad566754670a54f4fe5de593ef45712263fa428c5585910564565768f7e1
7
- data.tar.gz: e88b927288c5d9430c086c29cf04d0a240ec2efb3c4616d014a35b888681c8f63cc59af5772b3b4be43a42aeb869ab554d7728288136613e2b18496695f0ad72
6
+ metadata.gz: 2cc17f97d1b757fda40054563fac9979498800b97f799408624ab6b900baa007fc4d4be4a6337a8188b46942427985f3dab4a09f0d8c205b00a334f058f5cc2f
7
+ data.tar.gz: eb1484439dcd2074865c1b6a11cca07b7872b1e178ca685fc5cd24a414d5bf6538997c2cf7655702cac6b0ec43399fb919513010a4bb22335acf032f304689a8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quick_api (0.0.4)
4
+ quick_api (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -3,49 +3,49 @@ module QuickApi
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- class_attribute :quick_api_attributes
7
6
  # class_attribute :quick_api_methods
8
- class_attribute :quick_api_has_many
9
- class_attribute :quick_api_belongs_to
10
- class_attribute :quick_api_has_one
11
- class_attribute :quick_api_has_and_belongs_to_many
12
- class_attribute :quick_api_embeds_many
13
- class_attribute :quick_api_embedded_in
14
- class_attribute :quick_api_embeds_one
7
+ class_attribute :q_api_attributes
8
+ class_attribute :q_api_has_many
9
+ class_attribute :q_api_belongs_to
10
+ class_attribute :q_api_has_one
11
+ class_attribute :q_api_has_and_belongs_to_many
12
+ class_attribute :q_api_embeds_many
13
+ class_attribute :q_api_embedded_in
14
+ class_attribute :q_api_embeds_one
15
15
  end
16
16
 
17
17
  module ClassMethods
18
18
 
19
19
  def quick_api_attributes(*names)
20
- self.quick_api_attributes = names
20
+ self.q_api_attributes = names
21
21
  end
22
22
 
23
23
  def quick_api_has_many(*relations)
24
- self.quick_api_has_many = relations
24
+ self.q_api_has_many = relations
25
25
  end
26
26
 
27
27
  def quick_api_belongs_to(*relations)
28
- self.quick_api_belongs_to = relations
28
+ self.q_api_belongs_to = relations
29
29
  end
30
30
 
31
31
  def quick_api_has_one(*relations)
32
- self.quick_api_has_one = relations
32
+ self.q_api_has_one = relations
33
33
  end
34
34
 
35
35
  def quick_api_has_and_belongs_to_many(*relations)
36
- self.quick_api_has_and_belongs_to_many = relations
36
+ self.q_api_has_and_belongs_to_many = relations
37
37
  end
38
38
 
39
39
  def quick_api_embeds_many(*relations)
40
- self.quick_api_embeds_many = relations
40
+ self.q_api_embeds_many = relations
41
41
  end
42
42
 
43
43
  def quick_api_embedded_in(*relations)
44
- self.quick_api_embedded_in = relations
44
+ self.q_api_embedded_in = relations
45
45
  end
46
46
 
47
47
  def quick_api_embeds_one(*relations)
48
- self.quick_api_embeds_one = relations
48
+ self.q_api_embeds_one = relations
49
49
  end
50
50
 
51
51
  # def quick_api_methods(*methods)
@@ -58,7 +58,7 @@ module QuickApi
58
58
  if options[:fields]
59
59
  api_fields = options[:fields]
60
60
  else
61
- api_fields = self.quick_api_attributes.nil? ? [] : self.quick_api_attributes
61
+ api_fields = self.q_api_attributes.nil? ? [] : self.q_api_attributes
62
62
  end
63
63
  api_fields.each do |api_field|
64
64
  begin
@@ -88,13 +88,13 @@ module QuickApi
88
88
  # end
89
89
 
90
90
  if options[:relations] == true
91
- result = api_many_options(result, self.quick_api_has_many) if self.quick_api_has_many
92
- result = api_belongs_or_one_options(result, self.quick_api_belongs_to) if self.quick_api_belongs_to
93
- result = api_belongs_or_one_options(result, self.quick_api_has_one) if self.quick_api_has_one
94
- result = api_many_options(result, self.quick_api_has_and_belongs_to_many) if self.quick_api_has_and_belongs_to_many
95
- result = api_many_options(result, self.quick_api_embeds_many) if self.quick_api_embeds_many
96
- result = api_belongs_or_one_options(result, self.quick_api_embedded_in) if self.quick_api_embedded_in
97
- result = api_belongs_or_one_options(result, self.quick_api_embeds_one) if self.quick_api_embeds_one
91
+ result = api_many_options(result, self.q_api_has_many) if self.q_api_has_many
92
+ result = api_belongs_or_one_options(result, self.q_api_belongs_to) if self.q_api_belongs_to
93
+ result = api_belongs_or_one_options(result, self.q_api_has_one) if self.q_api_has_one
94
+ result = api_many_options(result, self.q_api_has_and_belongs_to_many) if self.q_api_has_and_belongs_to_many
95
+ result = api_many_options(result, self.q_api_embeds_many) if self.q_api_embeds_many
96
+ result = api_belongs_or_one_options(result, self.q_api_embedded_in) if self.q_api_embedded_in
97
+ result = api_belongs_or_one_options(result, self.q_api_embeds_one) if self.q_api_embeds_one
98
98
  end
99
99
 
100
100
  result = api_set_options(result, options)
@@ -1,3 +1,3 @@
1
1
  module QuickApi
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quick_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - SternCode