familyapp_sdk 0.1.1 → 0.1.2

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: 01b294b1689f4cc87b6591d9055252893c3f5121
4
- data.tar.gz: 2a54ce44d6abdd13ce044e6140b9a2db9c5f3b06
3
+ metadata.gz: 38fb8c70ef247b276d29c91fa2c033410484dd74
4
+ data.tar.gz: 405b466cddc2fc15ee2f5264d1ad8d329ccc9a6b
5
5
  SHA512:
6
- metadata.gz: 66f9a9a58f54e5cfef7cdd3d88f6d8855c01a1033d64e89304943f517f9c2a65d73b91a1e9210ed5eb35ab058e0469c689e53d3ac2cd56e8441718cba9a9a9d6
7
- data.tar.gz: 0a75189095e9c004ce271eefa141078e2231c38d5b01b97ad76db144ec61ac6c06b4f5b4edf460d0aa6fa0df9c5c99ab8e1d883e05812d21b7bc6b372ed1d60f
6
+ metadata.gz: 1af111e9cd46c64b3dac8447f51b6da626b4bb467ed01de649017f5d5580f485651fec42dd9e2af9d78b37884cb2a399da730644e9b9a9ac8a4a5a123a8a357e
7
+ data.tar.gz: aaf8c25e269a92ff8590d4679ebffe876403a956fff4312b4678aa6c40d6a70dc1e944c282dc335f0dc5a2406564207db9b6ada77b6f82a47d6ee53e1f78742e
data/.DS_Store CHANGED
Binary file
data/Rakefile CHANGED
@@ -4,3 +4,7 @@ require "rspec/core/rake_task"
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
+
8
+ task :console do
9
+ exec "irb -r familyapp_sdk -I ./lib"
10
+ end
@@ -0,0 +1,17 @@
1
+ module FamilyappSdk
2
+ module Components
3
+ class QuickReply
4
+ attr_accessor :title, :payload, :image
5
+
6
+ def initialize(title:, payload: nil, image: nil)
7
+ @title = title
8
+ @payload = payload
9
+ @image = image
10
+ end
11
+
12
+ def build
13
+ instance_values.delete_if { |_attribute, value| value.nil? }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,21 @@
1
+ module FamilyappSdk
2
+ class Message
3
+ attr_accessor :content, :image, :video, :template, :quick_replies
4
+
5
+ def initialize(content: nil, image: nil, video: nil, template: nil, quick_replies: nil)
6
+ @content = content
7
+ @image = image
8
+ @video = video
9
+ @template = template
10
+ @quick_replies_attributes = build_quick_replies(quick_replies)
11
+ end
12
+
13
+ def build
14
+ instance_values.delete_if { |_attribute, value| value.nil? }
15
+ end
16
+
17
+ def build_quick_replies(quick_replies)
18
+ quick_replies.map { |quick_reply| quick_reply.build } if quick_replies.present?
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module FamilyappSdk
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
data/lib/familyapp_sdk.rb CHANGED
@@ -21,3 +21,6 @@ end
21
21
 
22
22
  require 'familyapp_sdk/engine'
23
23
  require 'familyapp_sdk/client'
24
+ require 'familyapp_sdk/message'
25
+
26
+ require 'familyapp_sdk/components/quick_reply'
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.1
4
+ version: 0.1.2
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: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2017-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,8 +105,10 @@ files:
105
105
  - lib/.DS_Store
106
106
  - lib/familyapp_sdk.rb
107
107
  - lib/familyapp_sdk/client.rb
108
+ - lib/familyapp_sdk/components/quick_reply.rb
108
109
  - lib/familyapp_sdk/configuration.rb
109
110
  - lib/familyapp_sdk/engine.rb
111
+ - lib/familyapp_sdk/message.rb
110
112
  - lib/familyapp_sdk/version.rb
111
113
  homepage: http://rubygems.org/gems/familyapp_sdk
112
114
  licenses:
@@ -128,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
130
  version: '0'
129
131
  requirements: []
130
132
  rubyforge_project:
131
- rubygems_version: 2.5.2
133
+ rubygems_version: 2.6.13
132
134
  signing_key:
133
135
  specification_version: 4
134
136
  summary: Familyapp SDK