portatext 1.1.0 → 1.1.1

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: 0661f1e3395426b8489b33618df49c4c8716c3e5
4
- data.tar.gz: fd06cc0d25f63299ce7b3b27653e17e73b390c29
3
+ metadata.gz: a8ef581d57fc7b2b4a813b6522661766edc4388b
4
+ data.tar.gz: 4dddcf5fd947ddd806cb5d2a7fb6090720e12257
5
5
  SHA512:
6
- metadata.gz: e10a66cab30f916858fe5a7e9f513f1ebfd235b8cea3e26afd037039ece1254735e02922e3b3f0ab056dd9a9fbb92feda276c6fb781cd362726ca00e2cf3ec19
7
- data.tar.gz: 7529c36d6774f8735418eb72215c2af0f4ee0d63d0f55967d6f0df020a0a549fa66fa4e0051132f9bd9b1a58a7626ddf445e334db041c5bb85fb5db5341af241
6
+ metadata.gz: 576c63568bd6bc6b8c6370af7d0a6302cafccf7b642a40997260d5984031adea3003f7c573c1e58d5e937f499bf2e2a5d1522034f0b6ebdc48ef14ccab06c8ef
7
+ data.tar.gz: e66e7fefa293cbb06b75b62ddd39f60bb9f616de78aefff46b0805caf86707d9d45cdd983ec4ff748af81974b7cac434caf14120565c0430721503931890dcdf
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![License](http://img.shields.io/badge/license-APACHE2-blue.svg)](http://img.shields.io/badge/license-APACHE2-blue.svg)
2
2
  [![Gem Version](https://badge.fury.io/rb/portatext.svg)](https://badge.fury.io/rb/portatext)
3
- [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/portatext/ruby-sdk/1.1.0)
3
+ [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/portatext/ruby-sdk)
4
4
 
5
5
  [![Build Status](https://travis-ci.org/PortaText/ruby-sdk.svg)](https://travis-ci.org/PortaText/ruby-sdk)
6
6
  [![Coverage Status](https://coveralls.io/repos/PortaText/ruby-sdk/badge.svg?branch=master&service=github)](https://coveralls.io/github/PortaText/ruby-sdk?branch=master)
@@ -0,0 +1,40 @@
1
+ module PortaText
2
+ module Command
3
+ module Api
4
+ # The me/password endpoint.
5
+ # https://github.com/PortaText/docs/wiki/REST-API#api_me_password
6
+ #
7
+ # Author:: Marcelo Gornstein (mailto:marcelog@portatext.com)
8
+ # Copyright:: Copyright (c) 2015 PortaText
9
+ # License:: Apache-2.0
10
+ class MyPassword < Base
11
+ def reset
12
+ set :reset, true
13
+ end
14
+
15
+ def for_email(email)
16
+ set :email, email
17
+ end
18
+
19
+ def with_nonce(nonce, new_password)
20
+ set :nonce, nonce
21
+ set :new_password, new_password
22
+ end
23
+
24
+ def change(old_password, new_password)
25
+ set :old_password, old_password
26
+ set :new_password, new_password
27
+ end
28
+
29
+ def endpoint(_method)
30
+ return 'me/password' if @args[:reset].nil?
31
+ @args.delete :reset
32
+ return 'me/password/reset' if @args[:nonce].nil?
33
+ nonce = @args[:nonce]
34
+ @args.delete :nonce
35
+ "me/password/reset/#{nonce}"
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
data/lib/portatext.rb CHANGED
@@ -32,6 +32,7 @@ require_relative 'portatext/command/api/blacklist'
32
32
  require_relative 'portatext/command/api/campaigns'
33
33
  require_relative 'portatext/command/api/sms_campaign'
34
34
  require_relative 'portatext/command/api/campaign_lifecycle'
35
+ require_relative 'portatext/command/api/my_password'
35
36
 
36
37
  # The PortaText namespace.
37
38
  #
data/portatext.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'portatext'
3
- s.version = '1.1.0'
3
+ s.version = '1.1.1'
4
4
  s.summary = 'Official PortaText API ruby client'
5
5
  s.description = 'This is the official PortaText API ruby client'
6
6
  s.authors = ['PortaText']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: portatext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - PortaText
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-28 00:00:00.000000000 Z
11
+ date: 2016-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -151,6 +151,7 @@ files:
151
151
  - lib/portatext/command/api/email_verify.rb
152
152
  - lib/portatext/command/api/jobs.rb
153
153
  - lib/portatext/command/api/me.rb
154
+ - lib/portatext/command/api/my_password.rb
154
155
  - lib/portatext/command/api/recharge.rb
155
156
  - lib/portatext/command/api/settings.rb
156
157
  - lib/portatext/command/api/sms.rb