plate_api 1.0.0 → 1.1.0

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: 47fb3d26ae744fae7daf830907607587c1978be77029fa8d4cade526edeeccfe
4
- data.tar.gz: 2f3e0817b62ee8f7bd344785adc353b12fb9189c539925ba7da7f181ede52246
3
+ metadata.gz: 8d6286414ebf7faeb04ee3886b71b11b367cbb1d39138e06a96960bd73aa9012
4
+ data.tar.gz: c7cf1783b9491e1dfc41399c1b93133997573723aaee8c5df04e96298a7998b1
5
5
  SHA512:
6
- metadata.gz: b8a9bba6f6bc0582813b0df46d5a72d3f5de015e4bb5dcbf66bcd52fc043bb354db6bba5e9d2379160f0fbc96c3077d43914094ef8d3c09572381a1b8e4e8788
7
- data.tar.gz: f66601a98fad886c26a10106697ea5c0632f423513581fce78431cfa094d97e980e04b83acb89a8a0917d90041ebde34c28cf7b215a1b2afcd7f6c9bc166b544
6
+ metadata.gz: 7dea1b06ec0c8ae3bbfb718f87e4bcb13bd9e2fd822d78ca51ebbf91a8fa3eceafc247174a72d9368b41b78b6f935a60363f1a67823186afe0167776077ad2ff
7
+ data.tar.gz: af44af8cf34d342fe1650c137d754d57ad1323ee5f6fbc4b542706eb4b867545aba385b245e50369701cbdd5d3246458c5fca30dd604233c6a1c587ea0596dcc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plate_api (1.0.0)
4
+ plate_api (1.1.0)
5
5
  faraday (~> 0.15.4)
6
6
  faraday_middleware (~> 0.13.1)
7
7
  mimemagic (~> 0.3.3)
@@ -43,7 +43,8 @@ module PlateApi
43
43
  sections: PlateApi::PlateObject::Section,
44
44
  rows: PlateApi::PlateObject::Row,
45
45
  columns: PlateApi::PlateObject::Column,
46
- elements: PlateApi::PlateObject::Element
46
+ elements: PlateApi::PlateObject::Element,
47
+ attachments: PlateApi::PlateObject::Attachment
47
48
  }
48
49
  end
49
50
 
@@ -66,11 +66,11 @@ module PlateApi
66
66
  end
67
67
  end
68
68
 
69
- def index(parent_class, parent_id)
69
+ def index(parent_class, parent_id, extra_params={})
70
70
  raise ArgumentError.new("`parent_id` given for #index is not valid") unless parent_id
71
71
  raise ArgumentError.new("`parent_class` given for #index is not valid") unless parent_class
72
72
 
73
- result = @api_connector.get(collection_path(parent_class, parent_id))
73
+ result = @api_connector.get(collection_path(parent_class, parent_id), extra_params)
74
74
  if result["data"]
75
75
  return result["data"].map{|x| new_object(x)}
76
76
  else
@@ -93,8 +93,8 @@ module PlateApi::PlateObject
93
93
  end
94
94
 
95
95
  def self.define_has_many_method(plural_name, klass)
96
- define_method(plural_name.to_s) do
97
- @object_handler.api_connector.handler(Object.const_get(klass)).index(self.class, @id)
96
+ define_method(plural_name.to_s) do |params={}|
97
+ @object_handler.api_connector.handler(Object.const_get(klass)).index(self.class, @id, params)
98
98
  end
99
99
  end
100
100
 
@@ -1,3 +1,3 @@
1
1
  module PlateApi
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plate_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Kortleven