Class: Moonshado::Sms::Keywords
- Inherits:
-
Object
- Object
- Moonshado::Sms::Keywords
- Defined in:
- lib/moonshado/keywords.rb
Defined Under Namespace
Classes: MoonshadoSMSException
Class Method Summary collapse
- .list ⇒ Object
- .register_keywords ⇒ Object
-
.valid_keywords? ⇒ Boolean
def self.destory(keyword) response = RestClient.delete(“#url/#keyword”) parse(response.body) end.
Class Method Details
.list ⇒ Object
5 6 7 8 9 |
# File 'lib/moonshado/keywords.rb', line 5 def list response = sender.get(configuration.keywords_uri) parse(response.body) end |
.register_keywords ⇒ Object
11 12 13 14 15 16 |
# File 'lib/moonshado/keywords.rb', line 11 def register_keywords raise MoonshadoSMSException.new("no keywords specified") unless valid_keywords? response = sender.send_to_moonshado({:keywords => configuration.keywords}, configuration.keywords_uri) parse(response.body) end |
.valid_keywords? ⇒ Boolean
def self.destory(keyword)
response = RestClient.delete("#{url}/#{keyword}")
parse(response.body)
end
23 24 25 |
# File 'lib/moonshado/keywords.rb', line 23 def valid_keywords? configuration.keywords.is_a?(Hash) && (!configuration.keywords.empty?) end |