Module: Phonify

Defined in:
lib/phonify.rb,
lib/phonify/version.rb

Constant Summary collapse

VERSION =
'1.0.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.tokenObject

Returns the value of attribute token.



8
9
10
# File 'lib/phonify.rb', line 8

def token
  @token
end

Class Method Details

.send_subscription_message(app, phone, body) ⇒ Object



10
11
12
13
# File 'lib/phonify.rb', line 10

def send_subscription_message(app, phone, body)
  response = post('v1/subscriptions/messages', app: app, phone: phone, body: body)
  response ? response[:id] : false
end

.subscription_active?(app, phone) ⇒ Boolean

Returns:



15
16
17
18
# File 'lib/phonify.rb', line 15

def subscription_active?(app, phone)
  response = get('v1/subscriptions/active', app: app, phone: phone)
  response ? response[:active] : false
end