messenger_client 0.2.1 → 0.2.2

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: 0e2cc74d6b64fa5e941388c38790c1ffebf748e7
4
- data.tar.gz: 17f320705bc86ab4a6ef52c567aa2d5f52b85c92
3
+ metadata.gz: '048b7dac7bdc602bf58b5e0c747a6272a6d0d340'
4
+ data.tar.gz: fcec367428c48d874372df550f73203e78b78113
5
5
  SHA512:
6
- metadata.gz: af3e5dd50fb1ff6b5e7999118e400466128b79d9086ab58af240bb906a928a6efa52b29a531ce81ff624d0292065828246487b005b517a24495f7418fef5c8d7
7
- data.tar.gz: 7dccae854ac850cbb48503ca90d08c6102b1a58b0b3275b2f8055be1d534528a766a3372bf25b790e50cd2889627ef9b922e07b8aa4c56cf7a94485c864b2689
6
+ metadata.gz: 3dcb39d188d2c7dfcd77a2374899aff6361dbc353bc10f42e41bc588cfacf8311691dc3ee2ddf23ae5eea725bbd5ff8aa1197816fca9d53cba4a0610e7357bf7
7
+ data.tar.gz: 38f2f9cfa2a7520c8079d6d9233dccd9a0d771f35a8318db86afd0215d131bde607ae90bec9c0df891b539ae2f8b3cca92fc496744cbab3ef8e3ad78174fdc3b
@@ -1,11 +1,11 @@
1
1
  module MessengerClient
2
2
  class ListTemplate < Template
3
- TEMPLATE_STYLES = %w(plain)
3
+ TEMPLATE_STYLES = %w(LARGE COMPACT)
4
4
 
5
- def initialize(template_items, buttons = [], style = nil)
5
+ def initialize(template_items, buttons = [], style = "LARGE")
6
6
  @template_items = template_items
7
- @buttons = buttons
8
- @style = style
7
+ @buttons = buttons
8
+ @style = style.upcase
9
9
  end
10
10
 
11
11
  def type
@@ -18,10 +18,8 @@ module MessengerClient
18
18
  elements: @template_items.map(&:to_json),
19
19
  }
20
20
 
21
- if !@style.nil?
22
- raise ArgumentError, "#{@style} is not a valid template style" unless TEMPLATE_STYLES.include?(@style)
23
- data.merge!(top_element_style: @style)
24
- end
21
+ raise ArgumentError, "#{@style} is not a valid template style. Your choices are #{TEMPLATE_STYLES.join(', ')}" unless TEMPLATE_STYLES.include?(@style)
22
+ data.merge!(top_element_style: @style)
25
23
 
26
24
  data.merge!(buttons: @buttons.map(&:to_json)) if @buttons.any?
27
25
  data
@@ -1,3 +1,3 @@
1
1
  module MessengerClient
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: messenger_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Cruz