Class: Sms77::Client

Inherits:
Base
  • Object
show all
Defined in:
lib/sms77/client.rb

Constant Summary

Constants inherited from Base

Base::BASE_PATH, Base::BUILDER, Base::CONN, Base::HTTP_GET, Base::HTTP_METHODS, Base::HTTP_POST

Instance Attribute Summary

Attributes inherited from Base

#api_key, #sent_with

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Sms77::Base

Instance Method Details

#analytics(params = {}) ⇒ Object



12
13
14
# File 'lib/sms77/client.rb', line 12

def analytics(params = {})
  get(Sms77::Endpoint::ANALYTICS, params)
end

#balanceObject



16
17
18
# File 'lib/sms77/client.rb', line 16

def balance
  get(Sms77::Endpoint::BALANCE)
end

#contacts(params) ⇒ Object



20
21
22
# File 'lib/sms77/client.rb', line 20

def contacts(params)
  get_or_post(Sms77::Contacts::Action::READ == params[:action], Sms77::Endpoint::CONTACTS, params)
end

#hooks(params) ⇒ Object



24
25
26
27
28
# File 'lib/sms77/client.rb', line 24

def hooks(params)
  Sms77::Hooks::Validator::validate(params)

  get_or_post(Sms77::Hooks::Action::READ == params[:action], Sms77::Endpoint::HOOKS, params)
end

#journal(params) ⇒ Object



30
31
32
# File 'lib/sms77/client.rb', line 30

def journal(params)
  get(Sms77::Endpoint::JOURNAL, params)
end

#lookup(params) ⇒ Object



34
35
36
# File 'lib/sms77/client.rb', line 34

def lookup(params)
  post(Sms77::Endpoint::LOOKUP, params)
end

#pricing(params = {}) ⇒ Object



38
39
40
# File 'lib/sms77/client.rb', line 38

def pricing(params = {})
  get(Sms77::Endpoint::PRICING, params)
end

#sms(params) ⇒ Object



42
43
44
# File 'lib/sms77/client.rb', line 42

def sms(params)
  post(Sms77::Endpoint::SMS, params)
end

#status(params) ⇒ Object



46
47
48
# File 'lib/sms77/client.rb', line 46

def status(params)
  get(Sms77::Endpoint::STATUS, params)
end

#validate_for_voice(params) ⇒ Object



50
51
52
# File 'lib/sms77/client.rb', line 50

def validate_for_voice(params)
  post(Sms77::Endpoint::VALIDATE_FOR_VOICE, params)
end

#voice(params) ⇒ Object



54
55
56
# File 'lib/sms77/client.rb', line 54

def voice(params)
  post(Sms77::Endpoint::VOICE, params)
end