telegrammer 0.6.1 → 0.6.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: 725b61fa8cb25386f77232d48030a47982aaefd4
4
- data.tar.gz: 8e50940cb2f539cbcf616b164921e610d7e353cb
3
+ metadata.gz: 1d0ee4efb76d8d569cc4082605df91692c262439
4
+ data.tar.gz: f8955b60e5c18a973835e27c307d0d5e3df744d0
5
5
  SHA512:
6
- metadata.gz: 470585dd3ee07e23b45857582b4e2393fbbbd9c385bd1166b9a75c0a83b9478a8122442148c7b5052a3b57615ef922e0554ce7a209f0f70bcca15e16e6e9c4f6
7
- data.tar.gz: 6d8ba416eefc3c4ca4717903f3dcb2834d440ac9d04115750c9ae42faf0b0fec43b8ecee0ec6b0b316ec8238f70779b77a2b2f9c89ee744c432c7d34964e37ca
6
+ metadata.gz: 8f71a0902ead755f1ccf41d3c7f78754cbfa7b4492b7627c9fcff5fdd6fc9516da04bda3386635573e4166038501884e7dd1377b39932ce96443d6ba29010e2b
7
+ data.tar.gz: db5a654a0873cc194c81fbbef051bcd0551b5e9d39f75b87ff2fe7fd1c0c68ebf4c0d697d0ac987845008a314bcd5107dd9ffea7fa8db0e8fac32fa0113452a8
data/CHANGELOG.md CHANGED
@@ -1,7 +1,12 @@
1
+ v0.6.2
2
+ ======
3
+
4
+ * Fixed user profile photos array with a custom datatype. Thanks to noma4i!
5
+
1
6
  v0.6.1
2
7
  ======
3
8
 
4
- * Updated operations that are using chat_id to also support "@channel" format (reported by @rkpasia in #15).
9
+ * Updated operations that are using chat_id to also support "@channel" format (reported by rkpasia in #15).
5
10
 
6
11
  v0.6.0
7
12
  ======
@@ -13,7 +18,7 @@ v0.6.0
13
18
  v0.5.1
14
19
  ======
15
20
 
16
- * Fixed an error raising some exceptions (reported by @nkaviani in #13)
21
+ * Fixed an error raising some exceptions (reported by nkaviani in #13)
17
22
 
18
23
  v0.5.0
19
24
  ======
@@ -422,7 +422,7 @@ module Telegrammer
422
422
 
423
423
  response = api_request('getUserProfilePhotos', params, params_validation)
424
424
 
425
- Telegrammer::DataTypes::UserProfilePhotos.new(response.result)
425
+ Telegrammer::DataTypes::UserProfilePhotos.new(response.result).to_h
426
426
  end
427
427
 
428
428
  # Get basic info about a file and prepare it for downloading.
@@ -0,0 +1,11 @@
1
+ class PhotoArray < Virtus::Attribute
2
+ primitive Array
3
+
4
+ def coerce(value)
5
+ if value.is_a?(Hash)
6
+ super(Telegrammer::DataTypes::PhotoSize.new(value))
7
+ else
8
+ super
9
+ end
10
+ end
11
+ end
@@ -8,7 +8,7 @@ module Telegrammer
8
8
  # See more at https://core.telegram.org/bots/api#userprofilephotos
9
9
  class UserProfilePhotos < Telegrammer::DataTypes::Base
10
10
  attribute :total_count, Integer
11
- attribute :photos, Array[PhotoSize]
11
+ attribute :photos, PhotoArray
12
12
  end
13
13
  end
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module Telegrammer
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
data/lib/telegrammer.rb CHANGED
@@ -4,6 +4,7 @@ require 'multi_json'
4
4
 
5
5
  require 'telegrammer/version'
6
6
 
7
+ require 'telegrammer/data_types/photo_array'
7
8
  require 'telegrammer/data_types/base'
8
9
  require 'telegrammer/data_types/audio'
9
10
  require 'telegrammer/data_types/chat'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegrammer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Mayoral
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-11 00:00:00.000000000 Z
11
+ date: 2015-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -105,6 +105,7 @@ files:
105
105
  - lib/telegrammer/data_types/group_chat.rb
106
106
  - lib/telegrammer/data_types/location.rb
107
107
  - lib/telegrammer/data_types/message.rb
108
+ - lib/telegrammer/data_types/photo_array.rb
108
109
  - lib/telegrammer/data_types/photo_size.rb
109
110
  - lib/telegrammer/data_types/reply_keyboard_hide.rb
110
111
  - lib/telegrammer/data_types/reply_keyboard_markup.rb
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  version: '0'
137
138
  requirements: []
138
139
  rubyforge_project:
139
- rubygems_version: 2.4.6
140
+ rubygems_version: 2.4.5.1
140
141
  signing_key:
141
142
  specification_version: 4
142
143
  summary: Ruby client for the Telegram's Bots API