Class: SerwerSMS::Resources::Blacklist
- Inherits:
-
Object
- Object
- SerwerSMS::Resources::Blacklist
- Defined in:
- lib/serwersms/resources/blacklist.rb
Instance Method Summary collapse
-
#add(phone) ⇒ Hash
Add phone to the blacklist.
-
#check(phone) ⇒ Hash
Check if phone is blacklisted.
-
#delete(phone) ⇒ Hash
Delete phone from the blacklist.
-
#index(phone = nil, params = {}) ⇒ Hash
List of blacklisted phones.
-
#initialize(client) ⇒ Blacklist
constructor
A new instance of Blacklist.
Constructor Details
#initialize(client) ⇒ Blacklist
Returns a new instance of Blacklist.
4 5 6 |
# File 'lib/serwersms/resources/blacklist.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#add(phone) ⇒ Hash
Add phone to the blacklist
14 15 16 |
# File 'lib/serwersms/resources/blacklist.rb', line 14 def add(phone) @client.call('blacklist/add', 'phone' => phone) end |
#check(phone) ⇒ Hash
Check if phone is blacklisted
41 42 43 |
# File 'lib/serwersms/resources/blacklist.rb', line 41 def check(phone) @client.call('blacklist/check', 'phone' => phone) end |
#delete(phone) ⇒ Hash
Delete phone from the blacklist
50 51 52 |
# File 'lib/serwersms/resources/blacklist.rb', line 50 def delete(phone) @client.call('blacklist/delete', 'phone' => phone) end |
#index(phone = nil, params = {}) ⇒ Hash
List of blacklisted phones
31 32 33 34 |
# File 'lib/serwersms/resources/blacklist.rb', line 31 def index(phone = nil, params = {}) params['phone'] = phone @client.call('blacklist/index', params) end |