Class: PushBot::Api
- Inherits:
-
Object
- Object
- PushBot::Api
- Defined in:
- lib/push_bot/api.rb
Instance Attribute Summary collapse
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#platforms ⇒ Object
Returns the value of attribute platforms.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#batch? ⇒ Boolean
Does this batch apply to a segment.
-
#initialize(token, platform) ⇒ Api
constructor
Create a new Api object with an associated token and platform.
-
#token? ⇒ Boolean
Does this request represent a tokened single user or is it a batch request.
-
#user? ⇒ Boolean
Does this request apply to a single user.
Constructor Details
Instance Attribute Details
#platform ⇒ Object
Returns the value of attribute platform.
3 4 5 |
# File 'lib/push_bot/api.rb', line 3 def platform @platform end |
#platforms ⇒ Object
Returns the value of attribute platforms.
3 4 5 |
# File 'lib/push_bot/api.rb', line 3 def platforms @platforms end |
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/push_bot/api.rb', line 3 def token @token end |
Instance Method Details
#batch? ⇒ Boolean
Does this batch apply to a segment
26 27 28 |
# File 'lib/push_bot/api.rb', line 26 def batch? !token? end |
#token? ⇒ Boolean
Does this request represent a tokened single user or is it a batch request
16 17 18 |
# File 'lib/push_bot/api.rb', line 16 def token? (defined?(@token) && @token) ? true : false end |
#user? ⇒ Boolean
Does this request apply to a single user
21 22 23 |
# File 'lib/push_bot/api.rb', line 21 def user? token? end |