familyapp_sdk 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8eae57f06f7ab27c26938cffdabda26035bc2889
4
- data.tar.gz: 14fdfb5f6e1f3dd12431e3d4f03792d5a55f5f83
3
+ metadata.gz: 2cc54613088cf59e165ec38d1838a88158a1ee1f
4
+ data.tar.gz: 3788872368bbeb2606a01afd9d1269d2f19bab71
5
5
  SHA512:
6
- metadata.gz: 913a07380e96750b1fa71b0c8dca19b57c1e7e404b29dfa1cd6dae76de50802bbab06edd01a223728eb13f24af5dfcbe94ac6bf45deaba2b779dce30c05e2ac3
7
- data.tar.gz: e813fc658fada4ece013fbf3c0021335c3430c56ecbb5f9a398b27a4611930266cc8a26b4f81853ec83e6319c4defa076f58c4de40d7cfe60f8a4f775b9b2c32
6
+ metadata.gz: 651abf1f18d64af99f0e172e1846446ec5706ed182aae30eba61e76bc44ed096e343337163a6bb47c0d9925a26d19128b3d797e923096d8ca73f671f90da1a0f
7
+ data.tar.gz: 94758a428a88d529fa92090beb234af18f80def3f5f732c28f108801f3a2c858e500ab240676eef1df52f157c3adf3fb488739ed43e5906df202844d7707a86f
@@ -1,21 +1,24 @@
1
1
  module FamilyappSdk
2
2
  module Components
3
3
  class Element
4
- attr_accessor :type, :title, :subtitle, :image, :url, :payload, :buttons
4
+ attr_accessor :title, :subtitle, :image, :url, :payload, :buttons
5
5
 
6
- def initialize(type:, title: nil, subtitle: nil, image: nil, url: nil, payload: nil, buttons: nil)
7
- @type = type
6
+ def initialize(title:, subtitle: nil, image: nil, url: nil, payload: nil, buttons: nil)
8
7
  @title = title
9
8
  @subtitle = subtitle
10
9
  @image = image
11
10
  @url = url
12
11
  @payload = payload
13
- @buttons = build_buttons(buttons)
12
+ @buttons = build_attributes(buttons)
14
13
  end
15
14
 
16
15
  def build
17
16
  instance_values.delete_if { |_attribute, value| value.nil? }
18
17
  end
18
+
19
+ def build_attributes(attributes)
20
+ attributes.map(&:build) if attributes.present?
21
+ end
19
22
  end
20
23
  end
21
24
  end
@@ -1,6 +1,6 @@
1
1
  module FamilyappSdk
2
2
  module Components
3
- class Templates
3
+ class Template
4
4
  attr_accessor :template_type, :elements_attributes, :buttons_attributes
5
5
 
6
6
  def initialize(type:, elements: nil, buttons: nil)
@@ -1,3 +1,3 @@
1
1
  module FamilyappSdk
2
- VERSION = '0.1.7'.freeze
2
+ VERSION = '0.1.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: familyapp_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Familyapp API Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-09 00:00:00.000000000 Z
11
+ date: 2018-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler